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.
This commit is contained in:
Gabriel Nagy 2022-07-05 15:15:32 +03:00 committed by Maas Lalani
parent 69bf367d37
commit 14d9f9cd76
No known key found for this signature in database
GPG Key ID: 5A6ED5CBF1A0A000

View File

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