fix(module: menu): the selected menu item would unselect itself (#611)

This commit is contained in:
James Yeung 2020-09-17 11:10:44 +08:00 committed by GitHub
parent 6d0d8020a3
commit 2d03d7fa53

View File

@ -124,18 +124,14 @@ namespace AntDesign
return;
}
foreach (MenuItem menuitem in MenuItems.Where(x => x != item))
{
menuitem.Deselect();
}
if (!item.IsSelected)
{
item.Select();
}
else
{
item.Deselect();
foreach (MenuItem menuitem in MenuItems.Where(x => x != item))
{
menuitem.Deselect();
}
}
StateHasChanged();