fix: require choice for multiselect

This commit is contained in:
Maas Lalani 2023-02-27 19:05:50 -05:00
parent 440a3dd81c
commit e6de7749b1
No known key found for this signature in database
GPG key ID: 5A6ED5CBF1A0A000

View file

@ -132,10 +132,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
case "enter":
m.quitting = true
// If the user hasn't selected any items in a multi-select.
// Then we select the item that they have pressed enter on. If they
// have selected items, then we simply return them.
if m.numSelected < 1 {
if m.limit <= 1 && m.numSelected < 1 {
m.items[m.index].selected = true
}
return m, tea.Quit