Browse Source

tui: prevent default Enter key behavior when selecting dialog options to avoid conflicts

Dax Raad 3 months ago
parent
commit
bfbcb5f200
1 changed files with 1 additions and 0 deletions
  1. 1 0
      packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx

+ 1 - 0
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx

@@ -130,6 +130,7 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
     if (evt.name === "return") {
     if (evt.name === "return") {
       const option = selected()
       const option = selected()
       if (option) {
       if (option) {
+        evt.preventDefault()
         if (option.onSelect) option.onSelect(dialog)
         if (option.onSelect) option.onSelect(dialog)
         props.onSelect?.(option)
         props.onSelect?.(option)
       }
       }