InputField cursor position must also be adjusted when SetText() is called. Fixes #180

This commit is contained in:
Oliver 2018-11-10 09:17:39 +01:00
parent 61a4cf388a
commit ec12437564
1 changed files with 1 additions and 0 deletions

View File

@ -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)
}