You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Never focus an item on menu open. There is no primary item we want. You can always use the keyboard to focus. There is no need to focus an item. And if you really want it, why are no items focused when open via button matMenuTriggerFor? The first focused item looks ugly and confused the user.
Actual Behavior
When I click on a button with matMenuTriggerFor the menu opens without any item is focused. Great.
But if I open the same menu via the MatMenuTrigger from ts-file (openMenu), the first item is focused.
Environment
Angular: 14
CDK/Material: 14
Browser(s): Chrome 106
Operating System: Windows 10
The text was updated successfully, but these errors were encountered:
When a menu opens, or when a menubar receives focus, keyboard focus is placed on the first item.
We're required to follow ARIA, and there is no requirement to not focus anything when the menu opens. For that reason, this is working as intended.
We hope the menu meets your needs. If you have specific requirements that are not satisfied, considering using the select component or a CDK primitive and building your own custom menu.
Please do not open another issue for this. If you believe this is closed in error, you can create a discussion and we can reconsider if there is enough feedback from the community.
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Ref. #15936 (closed but not accepted.) Allow an option for this if you insist. You can focus the mat-menu without focus an item.
Reproduction
Steps to reproduce:
Demo
Expected Behavior
Never focus an item on menu open. There is no primary item we want. You can always use the keyboard to focus. There is no need to focus an item. And if you really want it, why are no items focused when open via button matMenuTriggerFor? The first focused item looks ugly and confused the user.
Actual Behavior
When I click on a
button
withmatMenuTriggerFor
the menu opens without any item is focused. Great.But if I open the same menu via the MatMenuTrigger from ts-file (
openMenu
), the first item is focused.Environment
The text was updated successfully, but these errors were encountered: