fix: form tab input not responding to typing

Bug: t.inputs[t.focus].Update(msg) discarded the returned textinput.Model,
so typed characters were never stored in the input state.

Fix: capture both updated model and cmd from textinput.Update():
  t.inputs[t.focus], cmd = t.inputs[t.focus].Update(msg)
  return t, cmd

Same fix applied to all 3 forms (host, key, snippet).
Also moved ctrl+s out of default to its own case for clarity.
This commit is contained in:
swanadiva
2026-06-23 15:53:32 +07:00
parent daa20ac72b
commit 5b456104e8
3 changed files with 18 additions and 12 deletions
+6 -4
View File
@@ -154,11 +154,13 @@ func (t *HostFormTab) Update(msg tea.Msg) (Tab, tea.Cmd) {
case "shift+tab", "up":
t.prevField()
case "ctrl+s":
return t.submit()
default:
if msg.String() == "ctrl+s" {
return t.submit()
}
t.inputs[t.focus].Update(msg)
var cmd tea.Cmd
t.inputs[t.focus], cmd = t.inputs[t.focus].Update(msg)
return t, cmd
}
}