-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundarea: cdk/menu

Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Navigation does not occur on pressing Enter or Space when <a>
element has cdkMenuItem
.
<a routerLink="/" fragment="menu-1" cdkMenuItem>item 1</a>
I think the issue is caused by this line https://github.com/angular/components/blob/main/src/cdk/menu/menu-item.ts#L200
Reproduction
Steps to reproduce:
- https://stackblitz.com/edit/components-issue-nwpike?file=src%2Fapp%2Fexample-component.html
- Use keyboard to focus a link at the top and press Enter to navigate. Nothing happens.
- Use keyboard to focus a link at the bottom and press Enter to navigate. Navigation occurs.
Expected Behavior
Navigation should work with keyboard
Actual Behavior
Navigation does not work with keyboard
Environment
- Angular: 14.2.0
- CDK/Material: 14.2.0
- Browser(s): Google Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Metadata
Metadata
Assignees
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundarea: cdk/menu