From 79563a0d3f8c5b1d87f1cd77f869f208d8b539a2 Mon Sep 17 00:00:00 2001 From: Robert Mills <1240778+flippedcracker@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:01:56 -0700 Subject: [PATCH] Update group.go Fix cycling focus backwards --- components/group/group.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/group/group.go b/components/group/group.go index 378b6a7..b469545 100644 --- a/components/group/group.go +++ b/components/group/group.go @@ -128,7 +128,10 @@ func WithLayout(layout *layout.Layout) Option { func (g *Model) nextFocus() tea.Cmd { g.Current().Blur() - g.currFocus = (g.currFocus + 1) % len(g.items) + g.currFocus-- + if g.currFocus < 0 { + g.currFocus = len(g.items) - 1 + } return g.Current().Focus() }