Closed adamashton closed 1 year ago
This came about because I have a button that shows the Menu via a button click.
<button @onclick="ToggleMenu">Show Menu</button>
with
private async Task ToggleMenu() { if (menuIsShown) { await BlazorContextMenuService.HideMenu("menu"); } else { await BlazorContextMenuService.ShowMenu("menu", (int) mouseEventArgs.ClientX, (int) mouseEventArgs.ClientY); } menuIsShown = !menuIsShown; }
My local variable menuIsShown cannot be used because the Menu is set to AutoHide. I need another way of determining if the menu is shown. E.g.,
menuIsShown
if (BlazorContextMenuService.IsMenuShown("menu")) { await BlazorContextMenuService.HideMenu("menu"); } else { await BlazorContextMenuService.ShowMenu("menu", (int) mouseEventArgs.ClientX, mouseEventArgs.ClientY); }
I could not get the tests to run but I have attempted to write some.
Wow, thank you for contributing. I will merge and push a new version
the last version on nuget doesnt have any methos in "blazorContextMenuService" ? i had to install 1.16
Overview
This came about because I have a button that shows the Menu via a button click.
<button @onclick="ToggleMenu">Show Menu</button>
with
My local variable
menuIsShown
cannot be used because the Menu is set to AutoHide. I need another way of determining if the menu is shown. E.g.,Tests
I could not get the tests to run but I have attempted to write some.