How to fix: aria items outside their container
WCAG 2.2 success criterion 1.3.1 (level A)
Why it matters
Items like role="tab" or "menuitem" make no sense without their parent.
How to fix
Wrap them in the required parent role (tablist, menu, list).
<ul role="menu"><li role="menuitem">Settings</li></ul>
Test it yourself
- Inspect elements with role="tab", "option", "menuitem" or "listitem": each must sit inside an element with the matching parent role.
Common mistakes
- role="tab" buttons without a role="tablist" around them.
- Extra wrapper divs between the parent and the children, which break the link unless they have role="none".
Check your own site
Find this and other problems on your website in 30 seconds, free.