RadzenPanelMenu subitem marked as active also after navigation with parent collapse #1822

Closed
opened 2026-01-29 17:59:03 +00:00 by claunia · 6 comments
Owner

Originally created by @Anspitzen on GitHub (Jul 23, 2025).

Describe the bug
When navigating from child item to parent on a RadzenPanelMenuItem the child is also marked as active page when opening parent tree with arrow again

To Reproduce
Steps to reproduce the behavior:

  • PanelMenu on MainLayout
  • Parent Item has a page associated
  • Parent Item is expanded
  • You Navigate to the child item
  • Click on Parent (which will navigate to parent and collapse parent)
  • Expand Parent again with the arrow

Expected behavior
Only current active NavLink is marked as active, not previous child page also

Desktop (please complete the following information):

  • Browser chrome

Additional context
Only happens when following above order.
Active is also removed when opening the menu with another click on the parent PanelMenuItem

Originally created by @Anspitzen on GitHub (Jul 23, 2025). **Describe the bug** When navigating from child item to parent on a RadzenPanelMenuItem the child is also marked as active page when opening parent tree with arrow again **To Reproduce** Steps to reproduce the behavior: - PanelMenu on MainLayout - Parent Item has a page associated - Parent Item is expanded - You Navigate to the child item - Click on Parent (which will navigate to parent and collapse parent) - Expand Parent again with the arrow **Expected behavior** Only current active NavLink is marked as active, not previous child page also **Desktop (please complete the following information):** - Browser chrome **Additional context** Only happens when following above order. Active is also removed when opening the menu with another click on the parent PanelMenuItem
Author
Owner

@akorchev commented on GitHub (Jul 25, 2025):

Make sure the Match property is properly set - by default it is set to Prefix which could match items that start with the current path. Try setting it to NavLinkMatch.All

@akorchev commented on GitHub (Jul 25, 2025): Make sure the [Match](https://github.com/radzenhq/radzen-blazor/blob/49adc9517020325ef55ce2e770dd747a125bacf8/Radzen.Blazor/RadzenPanelMenu.razor.cs#L45) property is properly set - by default it is set to Prefix which could match items that start with the current path. Try setting it to `NavLinkMatch.All`
Author
Owner

@Anspitzen commented on GitHub (Jul 25, 2025):

Doesn't change it.
Set it to all (on both parent and child) and even have completely different paths (starting with like parent o and child with f)
Seems like the class rz-navigation-item-link-active does not get removed from child when parent is collapsing and child is not triggering its GetCssClasses() as it is not visible?
And opening it by the arrow does not trigger a re-evaluation of the CSS classes, so it stays. When opening parent by navigating to it it triggers a refresh of CSS classes, so child active class gets removed

@Anspitzen commented on GitHub (Jul 25, 2025): Doesn't change it. Set it to all (on both parent and child) and even have completely different paths (starting with like parent o and child with f) Seems like the class rz-navigation-item-link-active does not get removed from child when parent is collapsing and child is not triggering its GetCssClasses() as it is not visible? And opening it by the arrow does not trigger a re-evaluation of the CSS classes, so it stays. When opening parent by navigating to it it triggers a refresh of CSS classes, so child active class gets removed
Author
Owner

@akorchev commented on GitHub (Jul 25, 2025):

We will need some sample code that reproduces the issue.

@akorchev commented on GitHub (Jul 25, 2025): We will need some sample code that reproduces the issue.
Author
Owner

@Anspitzen commented on GitHub (Jul 25, 2025):

Unfortunately I can't test it on the Demo page (no access to the PanelMenu on the right to keep it same on navigation)
I'm still running the last 6.x Version of Radzen (Moving to Major 7 did break the apps too much, still working on fixing stuff there)

Minimal Code for MainLayout Sidebar:

<RadzenPanelMenu>
            <RadzenPanelMenuItem Text="Dashboard" Path="/" Icon="dashboard" />
            <RadzenPanelMenuItem Text="Parent" Path="parent" >
                <RadzenPanelMenuItem Text="Child" Path="child" />
            </RadzenPanelMenuItem>
</RadzenPanelMenu>

Of course needs some pages for the paths, but they can be empty. So I ommit them here.

Test process for error:
Start at index
Open Parent with the arrow (no navigation)
Navigate to Child
Navigate to Parent
Open Parent with the arrow (no navigation)

@Anspitzen commented on GitHub (Jul 25, 2025): Unfortunately I can't test it on the Demo page (no access to the PanelMenu on the right to keep it same on navigation) I'm still running the last 6.x Version of Radzen (Moving to Major 7 did break the apps too much, still working on fixing stuff there) Minimal Code for MainLayout Sidebar: ``` <RadzenPanelMenu> <RadzenPanelMenuItem Text="Dashboard" Path="/" Icon="dashboard" /> <RadzenPanelMenuItem Text="Parent" Path="parent" > <RadzenPanelMenuItem Text="Child" Path="child" /> </RadzenPanelMenuItem> </RadzenPanelMenu> ``` Of course needs some pages for the paths, but they can be empty. So I ommit them here. Test process for error: Start at index Open Parent with the arrow (no navigation) Navigate to Child Navigate to Parent Open Parent with the arrow (no navigation)
Author
Owner

@Anspitzen commented on GitHub (Jul 31, 2025):

One thing on the same general direction I can test on the Demo Page is the "Menu".
The real PanelMenu on the left is expanded, and when you navigate to the "menu" Component from the Demo part (General - Menu) then the Menu on the left in the real panelmenu is not marked as Match

@Anspitzen commented on GitHub (Jul 31, 2025): One thing on the same general direction I can test on the [Demo Page](https://blazor.radzen.com/panelmenu#panelmenu-static) is the "Menu". The real PanelMenu on the left is expanded, and when you navigate to the "menu" Component from the Demo part (General - Menu) then the Menu on the left in the real panelmenu is not marked as Match
Author
Owner

@akorchev commented on GitHub (Nov 27, 2025):

I still don't understand what the reported problem is even from the provided reproductions.

@akorchev commented on GitHub (Nov 27, 2025): I still don't understand what the reported problem is even from the provided reproductions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1822