Bug in Sidebar Component: Multiple NavItems Considered Active
NOTE: We do not look at .zip attachments for issue investigation.
Describe the bug We're using the Sidebar component with a DataProvider (just building a static list of elements). We have two nav items, with URLs like so:
/foo/foo/bar
The Sidebar should add the active CSS class to indicate the current page, which it does. Here I am when I'm at /foo:
However, if I'm on /foo/bar, both of these nav items are flagged as active, and thus both are shown as the current page, incorrectly:
To Reproduce
Add two Nav Items to a Sidebar component instance, one with a URL such as /foo, another which has a URL such as /foo/bar. Visit the /foo/bar route.
Expected behavior
Only The /foo/bar nav item should be considered Active
Versions (please complete the following information):
- .NET Version: .NET 9
- BlazorBootstrap: 3.4.0
Desktop (please complete the following information):
- OS: Windows 11, but reproduces in other environments (client/browser-agnostic)
- Browser: Confirmed in Firefox and Edge