Hiding autocomplete drop-down upon blur. Fixes #792

This commit is contained in:
Oliver 2023-01-04 13:54:15 +01:00
parent 1dc4a83aff
commit 807cb4dd91
1 changed files with 6 additions and 0 deletions

View File

@ -403,6 +403,12 @@ func (i *InputField) SetFinishedFunc(handler func(key tcell.Key)) FormItem {
return i return i
} }
// Blur is called when this primitive loses focus.
func (i *InputField) Blur() {
i.Box.Blur()
i.autocompleteList = nil // Hide the autocomplete drop-down.
}
// Draw draws this primitive onto the screen. // Draw draws this primitive onto the screen.
func (i *InputField) Draw(screen tcell.Screen) { func (i *InputField) Draw(screen tcell.Screen) {
i.Box.DrawForSubclass(screen, i) i.Box.DrawForSubclass(screen, i)