Reset cursor in SetValue when initial pos is 0

This commit is contained in:
Kiyon 2021-03-09 10:59:49 +08:00 committed by Christian Rocha
parent c8f4855d20
commit f719cc8cb1

View File

@ -139,7 +139,7 @@ func (m *Model) SetValue(s string) {
} else { } else {
m.value = runes m.value = runes
} }
if m.pos > len(m.value) { if m.pos == 0 || m.pos > len(m.value) {
m.SetCursor(len(m.value)) m.SetCursor(len(m.value))
} }
m.handleOverflow() m.handleOverflow()