-
Notifications
You must be signed in to change notification settings - Fork 985
Description
What is affected?
Accessibility, Component
Description
When defocusing a menu in a specific way, the following error appears in the console:
Blocked aria-hidden on an element because its descendant retained focus. The focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.
Element with focus: li
Ancestor with aria-hidden: <md-menu id="usage-menu" anchor="usage-anchor" aria-hidden="true">…
This error will only appear when the following conditions are met:
- The menu must be fully open (the menu will not auto-close otherwise)
- The new focus must be something outside of the current browser page (another tab, window, app, etc.)
- The error will only appear once per menu
Reproduction
https://material-web.dev/components/menu/
Workaround
I have not found a workaround
Is this a regression?
No or unsure. This never worked, or I haven't tried before.
Affected versions
2.2.0
Browser/OS/Node environment
Browser: Chrome 131.0.6778.205
OS: Windows 11