From c985e9bdc6c992967efd93bbebc639ab9e76aa12 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 24 Dec 2024 19:02:37 +0900 Subject: [PATCH] exp/handleinput: bug fix: Field.HandleInput unexpectedly returned true without any events --- exp/textinput/field.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exp/textinput/field.go b/exp/textinput/field.go index 4e4323383..f6ca00d03 100644 --- a/exp/textinput/field.go +++ b/exp/textinput/field.go @@ -118,13 +118,13 @@ func (f *Field) HandleInput(x, y int) (handled bool, err error) { f.err = state.Error return false, f.err } - handled = true if !ok { f.ch = nil f.end = nil f.state = State{} break readchar } + handled = true if state.Committed { f.text = f.text[:f.selectionStart] + state.Text + f.text[f.selectionEnd:] f.selectionStart += len(state.Text)