feat(dropdown): Trigger `selected` when drop down list selection is cancelled

This commit is contained in:
Andreas Bieber 2020-09-17 11:51:24 +02:00
parent e716d0acb9
commit 40efd84aad
1 changed files with 5 additions and 0 deletions

View File

@ -668,6 +668,11 @@ func (d *DropDown) openList(setFocus func(Primitive)) {
d.currentOption = optionBefore
d.list.SetCurrentItem(d.currentOption)
d.closeList(setFocus)
if d.selected != nil {
if d.currentOption > -1 {
d.selected(d.currentOption, d.options[d.currentOption])
}
}
} else {
d.prefix = ""
}