Fixed textinput bug

This commit is contained in:
june
2025-03-09 11:20:52 +13:00
parent 891ea79d53
commit ae05b237b4

View File

@@ -14,6 +14,10 @@ func (m model) Init() tea.Cmd {
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmd tea.Cmd
if m.addTask {
m.textinput, cmd = m.textinput.Update(msg)
}
switch msg := msg.(type) {
// Is it a key press?
@@ -73,9 +77,8 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
}
}
if m.addTask {
m.textinput, cmd = m.textinput.Update(msg)
}
// Return the updated model to the Bubble Tea runtime for processing.
// Note that we're not returning a command.
return m, cmd