-
Notifications
You must be signed in to change notification settings - Fork 459
[WIP] fix: keyboard navigation not working for FluentNavLink inside a FluentNavGroup #3998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: vnbaaij <[email protected]>
Co-authored-by: vnbaaij <[email protected]>
vnbaaij
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HandleNavLinkKeyDownAsync should not just handle the 'Enter' case. It should trigger the same action when 'Space' is pressed
Co-authored-by: vnbaaij <[email protected]>
Added Space key support to HandleNavLinkKeyDownAsync. Now both Enter and Space keys trigger navigation for better accessibility compliance. Changes committed in 698603e. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot onlt thing missing is that the Id parameter needs to be generated in the FluentNavLink constructor |
Co-authored-by: vnbaaij <[email protected]>
Added Id generation in FluentNavLink constructor using Identifier.NewId() to ensure proper keyboard handling anchors. Changes committed in 60df235. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
✅ All tests passed successfully Details on your Workflow / Core Tests page. |
Summary - Unit Tests Code CoverageSummary
CoverageMicrosoft.FluentUI.AspNetCore.Components - 60.5%
|
Fix: Keyboard navigation not working for FluentNavLink inside a FluentNavGroup
Problem Analysis
StopPropagation="@true"andPreventDefaultOnly="new[] { KeyCode.Enter, KeyCode.Left, KeyCode.Right }"Solution Implementation
Changes Made
FluentNavLink.razor: Added FluentKeyCode component that:
Hrefand anOwner(indicating it's inside a NavGroup){Id}-navlink)StopPropagation="@true"andPreventDefault="@true"FluentNavLink.razor.cs: Added
HandleNavLinkKeyDownAsyncmethod that:OnClickHandlerAsyncmethod to trigger navigationMicrosoft.AspNetCore.Components.WebTest Updates: Added test cases to verify the keyboard handling is correctly applied
How It Works
Fixes #3996.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.