edit: reset the cursor position

Whenever changing an edit' content with SetTitle() method the cursor
position must also be updated, otherwise the cursor will be placed based
on previous content.
This commit is contained in:
Leandro Dorileo 2018-03-20 14:54:52 -07:00
parent 492d582ad6
commit 8e0a86e5c7

View File

@ -34,6 +34,10 @@ func (e *EditField) setTitleInternal(title string) {
e.onChange(ev)
}
}
if title == "" {
e.cursorPos = xs.Len(title)
}
}
// Repaint draws the control on its View surface