Skip to content

Commit

Permalink
fix: select viewport on filtering (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitor-mariano authored Dec 22, 2023
1 parent 5163af8 commit 4bd4657
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions field_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ func (s *Select[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
if len(s.filteredOptions) > 0 {
s.selected = min(s.selected, len(s.filteredOptions)-1)
s.viewport.SetYOffset(clamp(s.selected, 0, len(s.filteredOptions)-s.viewport.Height))
}
}
}
Expand Down

0 comments on commit 4bd4657

Please sign in to comment.