From 588393fbf8f7c9b1af10343e9fcc2b433586db50 Mon Sep 17 00:00:00 2001 From: Gabriel Nagy Date: Tue, 5 Jul 2022 15:15:32 +0300 Subject: [PATCH] fix(textinput): set cursor on initial value This reverts the code back to the logic from 4ce16e8 which fixed the issue of the cursor not being moved when an initial value was set with SetValue. The fix regressed in 16053f4. --- textinput/textinput.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textinput/textinput.go b/textinput/textinput.go index 2ce04e7..eb7d414 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -205,7 +205,7 @@ func (m *Model) SetValue(s string) { } else { m.value = runes } - if (m.pos == 0 && len(m.value) == 0) || m.pos > len(m.value) { + if m.pos == 0 || m.pos > len(m.value) { m.setCursor(len(m.value)) } m.handleOverflow()