Release lock on InputField while executing DoneFunc and FinishedFunc

This commit is contained in:
Trevor Slocum 2020-10-02 17:00:57 -07:00
parent 3d1844e33b
commit 5a3409bfd6
4 changed files with 8 additions and 5 deletions

View File

@ -10,6 +10,7 @@ v1.5.0 (WIP)
- Provide DropDownOption in DropDown handlers
- Provide ListItem in List handlers
- Panic when attempting to add an invalid FormItem
- Release lock on InputField while executing DoneFunc and FinishedFunc
v1.4.9 (2020-09-08)
- Add InputField.GetCursorPosition and InputField.SetCursorPosition

2
go.mod
View File

@ -8,5 +8,5 @@ require (
github.com/mattn/go-runewidth v0.0.9
github.com/rivo/uniseg v0.1.0
gitlab.com/tslocum/cbind v0.1.2
golang.org/x/sys v0.0.0-20200928205150-006507a75852 // indirect
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f // indirect
)

4
go.sum
View File

@ -15,8 +15,8 @@ gitlab.com/tslocum/cbind v0.1.2/go.mod h1:HfB7qAhHSZbn1rFK8M9SvSN5NG6ScAg/3h3iE6
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 h1:DvY3Zkh7KabQE/kfzMvYvKirSiguP9Q/veMtkYyf0o8=
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200928205150-006507a75852 h1:sXxgOAXy8JwHhZnPuItAlUtwIlxrlEqi28mKhUR+zZY=
golang.org/x/sys v0.0.0-20200928205150-006507a75852/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

View File

@ -887,19 +887,21 @@ func (i *InputField) InputHandler() func(event *tcell.EventKey, setFocus func(p
i.Lock()
i.autocompleteList = nil
i.autocompleteListSuggestion = ""
i.Unlock()
} else {
i.Unlock()
finish(key)
}
i.Unlock()
return
case tcell.KeyEscape:
if i.autocompleteList != nil {
i.autocompleteList = nil
i.autocompleteListSuggestion = ""
i.Unlock()
} else {
i.Unlock()
finish(key)
}
i.Unlock()
return
case tcell.KeyDown, tcell.KeyTab: // Autocomplete selection.
if i.autocompleteList != nil {