Skip to content

Commit

Permalink
fix(textinput): out of bounds check
Browse files Browse the repository at this point in the history
Co-authored-by: Maas Lalani <maas@lalani.dev>
  • Loading branch information
rdnt and maaslalani authored Feb 2, 2024
1 parent ceddb4f commit 019f0ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion textinput/textinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ func (m *Model) AvailableSuggestions() []string {

// CurrentSuggestion returns the currently selected suggestion.
func (m *Model) CurrentSuggestion() string {
if len(m.matchedSuggestions) == 0 {
if m.currentSuggestionIndex >= len(m.matchedSuggestions) {
return ""
}

Expand Down

0 comments on commit 019f0ad

Please sign in to comment.