From 42fd5c76bb98eaeb6ec7d413247d0571183693eb Mon Sep 17 00:00:00 2001 From: Hojjat Date: Fri, 3 Apr 2026 16:37:09 -0600 Subject: [PATCH] feat: focus wrap-around The tab cycles around when we reach the last focusable --- core/src/widget/operation/focusable.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/widget/operation/focusable.rs b/core/src/widget/operation/focusable.rs index 25a67f68..85b27317 100644 --- a/core/src/widget/operation/focusable.rs +++ b/core/src/widget/operation/focusable.rs @@ -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() + } _ => {} }