From 21d1a2de103feb054ed27549a784db647c678352 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 28 May 2021 20:06:28 +0200 Subject: [PATCH] Fixed wrong mouse click test on drop-downs. Fixes #600 --- dropdown.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dropdown.go b/dropdown.go index a4a26ac..3813cbf 100644 --- a/dropdown.go +++ b/dropdown.go @@ -515,8 +515,8 @@ func (d *DropDown) MouseHandler() func(action MouseAction, event *tcell.EventMou return d.WrapMouseHandler(func(action MouseAction, event *tcell.EventMouse, setFocus func(p Primitive)) (consumed bool, capture Primitive) { // Was the mouse event in the drop-down box itself (or on its label)? x, y := event.Position() - _, rectY, _, _ := d.GetInnerRect() - inRect := y == rectY + rectX, rectY, rectWidth, _ := d.GetInnerRect() + inRect := y == rectY && x >= rectX && x < rectX+rectWidth if !d.open && !inRect { return d.InRect(x, y), nil // No, and it's not expanded either. Ignore. }