From fcb23827e45f00b9bca813c38b72c4eb9906a74d Mon Sep 17 00:00:00 2001 From: june Date: Sun, 9 Mar 2025 11:14:33 +1300 Subject: [PATCH] fixe bugg --- bubbletea.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bubbletea.go b/bubbletea.go index 9b3e395..a2890b8 100644 --- a/bubbletea.go +++ b/bubbletea.go @@ -50,11 +50,17 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // new task case "n": - m.addTask = true - m.textinput.Focus() + if !m.addTask { + m.addTask = true + m.textinput.Focus() + m.textinput.Reset() + } case "esc": - m.addTask = false + if m.addTask { + m.addTask = false + m.textinput.Reset() + } // The "enter" key and the spacebar (a literal space) toggle // the selected state for the item that the cursor is pointing at.