Ends in:
1 DAY
22 HRS
0 MIN
3 SEC
Ends in:
1 D
22 H
0 M
3 S
Open Closed

Set MenuItem as 'current' in navigation bar when navigating through other means #8430


User avatar
0
lba created
  • ABP Framework version: v8.2.2
  • UI Type: Blazor Server
  • Database System: EF Core
  • Steps to reproduce the issue:
    • Using Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton, insert MenuItem into navigation bar.
    • Navigate to the page the item points to by other means (like HTML anchor element).

When using the navigation bar to navigate, the corresponding MenuItem is set as "current".

We use custom CSS to indicate to the user which part of the application they're currently at (green underline, as seen in the images above). The user may also be redirected to a different part of the application when interacting with elements outside of the navigation bar. In that case, the corresponding MenuItem is not set as "current" (as shown in the image below).

How can this behaviour of setting a MenuItem as "current" be replicated when using other means (like HTML anchor element) to navigate to the same page?


2 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello ,

    As you mentioned, I made a project and verified that it was functioning well. I've included a [video] you to view.

    Can you try to once upgrade your framework version. Thank you.

  • User Avatar
    0
    lba created

    Hello Anjali Musmade, thank you for the response, but I think there's a misunderstanding.

    Let me clarify: When using the navigation bar, the selected MenuItem is set as current. The corresponding HTML list element also receives the class "current". This is what we use to highlight the MenuItem. This behaviour is exclusive to the navigation bar. My question is: when we navigate to, say, the "Project" page using an HTML anchor element instead of the navigation bar - how do we replicate this behaviour?

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35