diff options
Diffstat (limited to 'lib/ui/textinput.go')
-rw-r--r-- | lib/ui/textinput.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go index bcfe4a83..2b23f15d 100644 --- a/lib/ui/textinput.go +++ b/lib/ui/textinput.go @@ -89,6 +89,7 @@ func (ti *TextInput) StringRight() string { func (ti *TextInput) Set(value string) *TextInput { ti.text = []rune(value) ti.index = len(ti.text) + ti.scroll = 0 return ti } @@ -97,11 +98,10 @@ func (ti *TextInput) Invalidate() { } func (ti *TextInput) Draw(ctx *Context) { - scroll := ti.scroll - if !ti.focus { - scroll = 0 - } else { + scroll := 0 + if ti.focus { ti.ensureScroll() + scroll = ti.scroll } ti.ctx = ctx // gross |