fix per @jr81
This commit is contained in:
parent
8cf347b745
commit
a38d2cdc9b
1 changed files with 2 additions and 2 deletions
|
@ -364,8 +364,8 @@ func (i *InputField) InputHandler() func(event *tcell.EventKey, setFocus func(p
|
|||
// accepted.
|
||||
add := func(r rune) bool {
|
||||
newText := i.text[:i.cursorPos] + string(r) + i.text[i.cursorPos:]
|
||||
if i.accept != nil {
|
||||
return i.accept(newText, r)
|
||||
if i.accept != nil && !i.accept(newText, r) {
|
||||
return false
|
||||
}
|
||||
i.text = newText
|
||||
i.cursorPos += len(string(r))
|
||||
|
|
Loading…
Reference in a new issue