Skip to content

Commit

Permalink
prevent premature closing when selecting items (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli authored Jun 9, 2024
1 parent f2baa0b commit d0afed7
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions flixel/addons/ui/FlxUIDropDownMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit d0afed7

Please sign in to comment.