fix(dropdown): Select previous option in dropdown list when cancelling selection

This commit is contained in:
Andreas Bieber 2020-09-17 11:50:47 +02:00
parent f71273b9c8
commit e716d0acb9
1 changed files with 1 additions and 0 deletions

View File

@ -666,6 +666,7 @@ func (d *DropDown) openList(setFocus func(Primitive)) {
d.evalPrefix()
} else if event.Key() == tcell.KeyEscape {
d.currentOption = optionBefore
d.list.SetCurrentItem(d.currentOption)
d.closeList(setFocus)
} else {
d.prefix = ""