mirror of
https://github.com/charmbracelet/gum
synced 2024-05-21 07:36:44 +02:00
fix: require choice for multiselect
This commit is contained in:
parent
440a3dd81c
commit
e6de7749b1
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue