Fixed textinput bug

This commit is contained in:
june 2025-03-09 11:20:52 +13:00
parent 891ea79d53
commit ae05b237b4
Signed by untrusted user who does not match committer: breadone
GPG Key ID: FDC19FE143200483

View File

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