Skip to content

MudNavGroup: Fix Background Color After Click#11989

Merged
danielchalmers merged 2 commits intoMudBlazor:devfrom
mckaragoz:NavGroupBackgroundStyleOnFocus
Oct 31, 2025
Merged

MudNavGroup: Fix Background Color After Click#11989
danielchalmers merged 2 commits intoMudBlazor:devfrom
mckaragoz:NavGroupBackgroundStyleOnFocus

Conversation

@mckaragoz
Copy link
Member

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

@mudbot mudbot bot added the bug Unexpected behavior or functionality not working as intended label Oct 22, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@versile2 versile2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple fix, thanks!

@mckaragoz mckaragoz requested a review from versile2 October 29, 2025 20:29
@mckaragoz
Copy link
Member Author

mckaragoz commented Oct 29, 2025

Changed all, now it's the easiest possible fix.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :focus to :focus-visible for navigation link styling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danielchalmers danielchalmers changed the title NavGroup: Fix Background Color After Click MudNavGroup: Fix Background Color After Click Oct 31, 2025
@danielchalmers danielchalmers merged commit 25465d9 into MudBlazor:dev Oct 31, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants