mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-01-12 23:11:05 +03:00
Fix a bug where text inputs with no char limit couldn't take input
This commit is contained in:
parent
bf2d13df66
commit
7ef18ab69e
@ -151,7 +151,7 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
|
|||||||
m.pos = 0
|
m.pos = 0
|
||||||
return m, nil
|
return m, nil
|
||||||
case tea.KeyRune: // input a regular character
|
case tea.KeyRune: // input a regular character
|
||||||
if m.CharLimit > 0 && len(m.Value) < m.CharLimit {
|
if m.CharLimit <= 0 || len(m.Value) < m.CharLimit {
|
||||||
m.Value = m.Value[:m.pos] + string(msg.Rune) + m.Value[m.pos:]
|
m.Value = m.Value[:m.pos] + string(msg.Rune) + m.Value[m.pos:]
|
||||||
m.pos++
|
m.pos++
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user