From ae05b237b42eb41d3a93248644570d398b929213 Mon Sep 17 00:00:00 2001 From: june Date: Sun, 9 Mar 2025 11:20:52 +1300 Subject: [PATCH] Fixed textinput bug --- bubbletea.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bubbletea.go b/bubbletea.go index a2890b8..91d5ee5 100644 --- a/bubbletea.go +++ b/bubbletea.go @@ -13,6 +13,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) { @@ -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