Merge pull request #186 from ravenops/fix/185

Fixes #185
pull/188/head
rivo 6 years ago committed by GitHub
commit 0612ff69bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -364,8 +364,8 @@ func (i *InputField) InputHandler() func(event *tcell.EventKey, setFocus func(p
// accepted. // accepted.
add := func(r rune) bool { add := func(r rune) bool {
newText := i.text[:i.cursorPos] + string(r) + i.text[i.cursorPos:] newText := i.text[:i.cursorPos] + string(r) + i.text[i.cursorPos:]
if i.accept != nil { if i.accept != nil && !i.accept(newText, r) {
return i.accept(newText, r) return false
} }
i.text = newText i.text = newText
i.cursorPos += len(string(r)) i.cursorPos += len(string(r))

Loading…
Cancel
Save