Skip to content

Commit

Permalink
Update group.go
Browse files Browse the repository at this point in the history
Fix cycling focus backwards
  • Loading branch information
flippedcracker authored Oct 1, 2024
1 parent 766dd70 commit 79563a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/group/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 79563a0

Please # to comment.