Skip to content

Commit f42279e

Browse files
committed
Simplify checks for mouse up in Dropdown
1 parent 68d6501 commit f42279e

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

osu.Framework/Graphics/UserInterface/Dropdown.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -355,18 +355,14 @@ protected override void OnMouseUp(MouseUpEvent e)
355355
if (!ToggleOnMouseDown)
356356
return;
357357

358-
// Close dropdown when cursor is released outside the menu
359-
if (!Menu.IsHovered)
360-
{
361-
// Do not close the menu if we are releasing on the DropdownHeader
362-
if (!Header.IsHovered)
363-
Menu.Close();
358+
// Do not close the menu if we are releasing on DropdownHeader
359+
if (Header.IsHovered)
364360
return;
365-
}
366361

367-
// Cursor is inside the menu and possibly selecting an item,
368-
// commit that selection and close the menu
369-
((IDropdown)this).CommitPreselection();
362+
// Cursor is inside the menu and possibly selecting an item
363+
if (Menu.IsHovered)
364+
((IDropdown)this).CommitPreselection();
365+
370366
Menu.Close();
371367
}
372368

0 commit comments

Comments
 (0)