Fix dropdown focus

This commit is contained in:
Chris Miller 2019-11-05 01:43:35 +00:00 committed by Trevor Slocum
parent 5bac390ebc
commit 806d63d900
1 changed files with 2 additions and 2 deletions

View File

@ -484,7 +484,7 @@ func (d *DropDown) openList(setFocus func(Primitive), app *Application) {
if event.Buttons() != 0 {
// If a mouse button was pressed, cancel this capture.
app.SetMouseCapture(nil)
d.closeList(nil) // Close but don't focus.
d.closeList(event.SetFocus)
}
}
}
@ -496,7 +496,7 @@ func (d *DropDown) openList(setFocus func(Primitive), app *Application) {
func (d *DropDown) closeList(setFocus func(Primitive)) {
d.open = false
if setFocus != nil {
if d.list.HasFocus() {
setFocus(d)
}
}