Add JS toggle logic to close menu on nav link click

Introduced IJSRuntime to handle JavaScript calls and implemented `NavLinkClickedAsync` to automatically uncheck the menu toggle on navigation. Updated all NavLinks to trigger this logic, improving user experience by closing the menu after a link is clicked.
This commit is contained in:
Andre Beging
2025-03-27 17:48:03 +01:00
parent 6bc2757eb0
commit 4d646ad7f6
3 changed files with 51 additions and 30 deletions

View File

@@ -1,11 +1,9 @@
@inherits LayoutComponentBase
<PageTitle>FoodsharingSiegen.Server</PageTitle>
<AuthorizeView>
<Authorized>
<div class="page">
<input type="checkbox" id="menu-toggler"/>
<input type="checkbox" id="menu-toggler" />
<label id="menu-toggler-label" for="menu-toggler">
<span class="menu-toggler-line"></span>