From e4d6f4f3eec86b380a38a8c9271f35f5381702ef Mon Sep 17 00:00:00 2001 From: Chris Miller Date: Tue, 5 Nov 2019 01:43:35 +0000 Subject: [PATCH] Fix dropdown focus --- dropdown.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dropdown.go b/dropdown.go index 2c79f50..706beaf 100644 --- a/dropdown.go +++ b/dropdown.go @@ -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) } }