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 7cc5786984
commit 588393fbf8

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