Skip to content

Commit 579c73b

Browse files
chore: move m.search.Update out of case
1 parent 6e59ecb commit 579c73b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

cli/cliui/select.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -368,19 +368,18 @@ func (m multiSelectModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
368368
for _, option := range options {
369369
option.chosen = false
370370
}
371+
}
372+
}
371373

372-
default:
373-
oldSearch := m.search.Value()
374-
m.search, cmd = m.search.Update(msg)
375-
376-
// If the search query has changed then we need to ensure
377-
// the cursor is still pointing at a valid option.
378-
if m.search.Value() != oldSearch {
379-
options := m.filteredOptions()
380-
if m.cursor > len(options)-1 {
381-
m.cursor = max(0, len(options)-1)
382-
}
383-
}
374+
oldSearch := m.search.Value()
375+
m.search, cmd = m.search.Update(msg)
376+
377+
// If the search query has changed then we need to ensure
378+
// the cursor is still pointing at a valid option.
379+
if m.search.Value() != oldSearch {
380+
options := m.filteredOptions()
381+
if m.cursor > len(options)-1 {
382+
m.cursor = max(0, len(options)-1)
384383
}
385384
}
386385

0 commit comments

Comments
 (0)