md-menu: Blocked aria-hidden on an element because its descendant retained focus.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- accessibility, frontend
Research direction
Start with the linked md-menu reproduction and reproduce the Chrome console warning by fully opening the menu, moving focus outside the page, and allowing it to close. Trace the menu's focus and aria-hidden behavior, then verify that the warning no longer appears under those conditions without breaking normal menu closing or accessibility behavior.
Written by the indexing model from the issue text.
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
- Dominant language
- SCSS
- Stars
- 11.3k
- Forks
- 1.1k
- Avg merge
- 20h 28m
- Merged PRs (30d)
- 13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from material-components/material-web
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
material-components/material-web#6014 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
material-components/material-web#6030 ·
-
Agent Skill Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
material-components/material-web#5918 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
material-components/material-web#5894 · 12 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
material-components/material-web#5888 · 16 reactions ·
All issues in material-components/material-web
Similar issues
-
accessibility angular bug good first issue typescript ux
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/fineract-backoffice-ui#584 · 1 comment ·
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
spartan-ng/spartan#1763 ·
-
Access Score Gallery Label Map
Difficulty 2/5 Half a day Newbie friendliness 68/100
ProjectSidewalk/SidewalkWebpage#5430 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100