Skip to content

Commit

Permalink
fix: require choice for multiselect
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Feb 28, 2023
1 parent 440a3dd commit e6de774
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions choose/choose.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e6de774

Please sign in to comment.