Fix dropdown focus
This commit is contained in:
parent
5bac390ebc
commit
806d63d900
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue