mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-24 14:44:38 +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
|
||||
return m, nil
|
||||
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.pos++
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user