Browse Source

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

tablepad
Andreas Bieber 2 years ago
parent
commit
40efd84aad
  1. 5
      dropdown.go

5
dropdown.go

@ -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 = ""
}

Loading…
Cancel
Save