feat: focus wrap-around
The tab cycles around when we reach the last focusable
This commit is contained in:
parent
2d4ede1597
commit
42fd5c76bb
1 changed files with 8 additions and 0 deletions
|
|
@ -143,6 +143,9 @@ where
|
|||
match self.count.focused {
|
||||
None if self.current == self.count.total - 1 => state.focus(),
|
||||
Some(0) if self.current == 0 => state.unfocus(),
|
||||
Some(0) if self.current == self.count.total - 1 => {
|
||||
state.focus()
|
||||
}
|
||||
Some(0) => {}
|
||||
Some(focused) if focused == self.current => state.unfocus(),
|
||||
Some(focused) if focused - 1 == self.current => state.focus(),
|
||||
|
|
@ -183,6 +186,11 @@ where
|
|||
None if self.current == 0 => state.focus(),
|
||||
Some(focused) if focused == self.current => state.unfocus(),
|
||||
Some(focused) if focused + 1 == self.current => state.focus(),
|
||||
Some(focused)
|
||||
if focused == self.count.total - 1 && self.current == 0 =>
|
||||
{
|
||||
state.focus()
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue