diff --git a/flixel/addons/ui/FlxUIDropDownMenu.hx b/flixel/addons/ui/FlxUIDropDownMenu.hx index f7a5696..8babaf0 100644 --- a/flixel/addons/ui/FlxUIDropDownMenu.hx +++ b/flixel/addons/ui/FlxUIDropDownMenu.hx @@ -405,17 +405,30 @@ class FlxUIDropDownMenu extends FlxUIGroup implements IFlxUIWidget implements IF public override function update(elapsed:Float):Void { super.update(elapsed); - + #if FLX_MOUSE + checkClickOff(); + #end + } + + #if FLX_MOUSE + function checkClickOff() + { if (dropPanel.visible && FlxG.mouse.justPressed) { - if (!FlxG.mouse.overlaps(this)) + if (header.button.justPressed) + return; + + for (button in list) { - showList(false); + if (button.justPressed) + return; } + + showList(false); } - #end } + #end override public function destroy():Void {