From ec1243756403522020a7d5ea7c00aed57bdc920c Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sat, 10 Nov 2018 09:17:39 +0100 Subject: [PATCH] InputField cursor position must also be adjusted when SetText() is called. Fixes #180 --- inputfield.go | 1 + 1 file changed, 1 insertion(+) diff --git a/inputfield.go b/inputfield.go index c6b1a17..a0b193b 100644 --- a/inputfield.go +++ b/inputfield.go @@ -102,6 +102,7 @@ func NewInputField() *InputField { // SetText sets the current text of the input field. func (i *InputField) SetText(text string) *InputField { i.text = text + i.cursorPos = len(text) if i.changed != nil { i.changed(text) }