MudNavGroup: Fix Background Color After Click#11989
MudNavGroup: Fix Background Color After Click#11989danielchalmers merged 2 commits intoMudBlazor:devfrom
Conversation
There was a problem hiding this comment.
Code Review
The pull request aims to fix a visual issue in the MudNavGroup component where the background color remained grayed after a click, causing confusion with the active navlink. The solution implemented changes the background color behavior to only change on keyboard navigation, not mouse clicks. The change involves modifying the CSS styles for the mud-nav-link class to differentiate between :focus and :focus-visible states.
|
Changed all, now it's the easiest possible fix. |
There was a problem hiding this comment.
Pull Request Overview
This PR improves the accessibility and user experience of navigation menu links by changing the focus styling from :focus to :focus-visible. This ensures that focus outlines only appear when navigating via keyboard, not when clicking with a mouse, providing a cleaner visual experience while maintaining accessibility for keyboard users.
- Changed CSS pseudo-class from
:focusto:focus-visiblefor navigation link styling
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MudNavGroup has grayed background after click. That causes a confusing visual: Active navlink and last clicked navgroup has same background color.
We changed the behavior. The background color only changes when navigated with keyboard, not click with mouse.
Before:
20251022_220353.mp4
After:
20251022_220714.mp4