examples/textinput: bug fix: reset the state after committing

This commit is contained in:
Hajime Hoshi 2023-08-02 18:09:13 +09:00
parent af5edf136d
commit 2b03637b52

View File

@ -181,7 +181,7 @@ func (t *TextField) Update() {
t.text = t.text[:t.selectionStart] + state.Text + t.text[t.selectionEnd:] t.text = t.text[:t.selectionStart] + state.Text + t.text[t.selectionEnd:]
t.selectionStart += len(state.Text) t.selectionStart += len(state.Text)
t.selectionEnd = t.selectionStart t.selectionEnd = t.selectionStart
state = textinput.State{} t.state = textinput.State{}
continue continue
} }
t.state = state t.state = state