mirror of https://github.com/rivo/tview.git
InputField cursor position must also be adjusted when SetText() is called. Fixes #180
This commit is contained in:
parent
61a4cf388a
commit
ec12437564
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue