-
Notifications
You must be signed in to change notification settings - Fork 459
Description
🐛 Bug Report
FluentNavLink does not create a link when the Href parameter is empty.
This is different from the expected behavior of NavLink component that comes with the Blazor framework, where an empty Href creates a link to the root of the application. In an unmodified Blazor WebAssembly Standalone App template available on Visual Studio, this is how the link to the root of the application is written in NavMenu.razor:
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Counter
</NavLink>
</div>...the link does not work anymore after switching NavLink to FluentNavLink.
This is not a big issue as passing ./ to the Href parameter seems to achieve the same result but it would be better if the behavior of FluentNavLink matches that of NavLink.
🤔 Expected Behavior
An empty string passed to the Href parameter of FluentNavLink should create a link to the root of the Blazor application.
😯 Current Behavior
An empty string passed to the Href parameter of FluentNavLink does not create a link at all.
💁 Possible Solution
Remove the !string.IsNullOrEmpty(Href) condition on FluentNavLink.razor