Browse Source

Try fix subitems

pull/5682/head
amwx 5 years ago
parent
commit
3e09bdfd09
  1. 11
      src/Avalonia.Controls/Flyouts/MenuFlyoutPresenter.cs

11
src/Avalonia.Controls/Flyouts/MenuFlyoutPresenter.cs

@ -29,7 +29,16 @@ namespace Avalonia.Controls
var host = this.FindLogicalAncestorOfType<Popup>();
if (host != null)
{
host.IsOpen = false;
for (int i = 0; i < LogicalChildren.Count; i++)
{
if (LogicalChildren[i] is MenuItem item)
{
item.IsSubMenuOpen = false;
}
}
SelectedIndex = -1;
host.IsOpen = false;
}
}

Loading…
Cancel
Save