Skip to content

Commit

Permalink
Fixes #573 by closing the context menu if no items are visible
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Jun 26, 2018
1 parent 501fd84 commit da392cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
- [#562](../../issues/562) - Pressing "right" arrow key to open submenu on menuitem causes NullRef exception when there is no submenu
- [#564](../../issues/564) - Gallery overflow panel (with menu items) doesn't close when clicking once in the application
- [#572](../../issues/572) - KeyTip.Keys Position
- [#573](../../issues/573) - Empty context menu on controls and ribbon

- ### Enhancements
- [#516](../../issues/516) - Add options to hide the row containing RibbonTabItems
Expand Down
6 changes: 6 additions & 0 deletions Fluent.Ribbon/Controls/Ribbon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ private static void OnContextMenuOpened(object sender, RoutedEventArgs e)
}
}
}

// We have to close the context menu if no items are visible
if (RibbonContextMenu.Items.OfType<MenuItem>().All(x => x.Visibility == Visibility.Collapsed))
{
RibbonContextMenu.IsOpen = false;
}
}

#endregion
Expand Down

0 comments on commit da392cb

Please sign in to comment.