Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rds1983 committed Sep 4, 2024
1 parent 13e6bb7 commit c7626d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
8 changes: 0 additions & 8 deletions src/Myra/Graphics2D/UI/Selectors/ComboView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,6 @@ public ComboView(string styleName = Stylesheet.DefaultStyleName)
SetStyle(styleName);
}

internal void HideDropdown()
{
if (Desktop != null && Desktop.ContextMenu == _listView)
{
Desktop.HideContextMenu();
}
}

private void DesktopOnContextMenuClosed(object sender, GenericEventArgs<Widget> genericEventArgs)
{
// Unpress the button only if mouse is outside
Expand Down
6 changes: 2 additions & 4 deletions src/Myra/Graphics2D/UI/Selectors/ListView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,10 @@ private void ButtonOnClick(object sender, EventArgs eventArgs)

private void ComboHideDropdown()
{
if (_parentCombo == null)
if (Desktop != null && Desktop.ContextMenu == this)
{
return;
Desktop.HideContextMenu();
}

_parentCombo.HideDropdown();
}

protected void OnSelectedItemChanged()
Expand Down

0 comments on commit c7626d4

Please sign in to comment.