summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaas Lalani <maas@lalani.dev>2023-02-27 19:05:50 -0500
committerMaas Lalani <maas@lalani.dev>2023-02-27 19:05:50 -0500
commite6de7749b139c3ff38285437d390f5f92e1689fb (patch)
treecd4945a9ab309a3ac40cb917fd36491e6ee2e676
parent440a3dd81c849fc4bf9c2e9447b1522134b34b1e (diff)
fix: require choice for multiselect
-rw-r--r--choose/choose.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/choose/choose.go b/choose/choose.go
index 468dc04..2b1b113 100644
--- a/choose/choose.go
+++ b/choose/choose.go
@@ -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