[Masthead]: Add a logic that highlights the current and parent menu items within the Masthead dropdown + Mega Menu based on the URL
See original GitHub issueThe problem
- The current
dds-masthead-container
component does not have a logic in place that highlights the current and parent menu items according to the current URL of the page. - There’s a style in place for the
active
state, however, this attribute should be updated/applied in the shadow Dom where we’re rendering the menu items. - As part of the Unified Cloud Masthead + Megamenu project, we’d like to ensure that users understand where within the page that are on especially when you’re navigating 2 to 3 levels down.
Example
Purposed solution
- Add a script that executes and compares the
href
of each menu link to the current page URL starting after the domain name and assigns the correctactive
styling to the appropriate menu item. - I know that this request might be a bit tricky, so I’m open to suggestions.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
[Masthead] React: Change component to include logic that ...
[Masthead] React: Change component to include logic that highlights the current and parent menu items within the Masthead dropdown + Mega Menu based...
Read more >IBM CIO Enterprise Internal - Percy | Visual testing as a service
#6937 feat(masthead): Add a logic that highlights the current and parent menu items within the Masthead dropdown + Mega Menu based on the...
Read more >Fly-out Menus | Web Accessibility Initiative (WAI)
Use fly-out (or drop-down) menus to provide an overview of a web site's page ... Indicate navigation menu items with submenus visually and...
Read more >Menu Item Options – Getting Started Guide
A guide explaining the various menu item options available in Max Mega Menu. ... To adjust the mega menu settings for an item,...
Read more >Elementor Nav Menu: Powerful WordPress Menu Builder
Elementor Menu widget allows you to create professional menus in minutes, without having to edit CSS. Learn all about Elementor WordPress ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
All linked issues are closed.
Summarizing the decisions in a bit more visual format. Notice the difference between desktop & mobile usage of selected state styles: