Skip to main content
Raasta
CriticalWCAG 1.3.1 · Level Aaria-required-parent

ARIA role is outside the parent it needs

Roles such as tab, option and menuitem only make sense inside their parent role (tablist, listbox, menu), and on their own they lose their grouping and position. Wrap them in an element with the right parent role, or remove the child role.

Who it hurts

Screen reader users, who hear a tab or option with no group, count or position.

Often caused by a wrapper <div> added for styling between the parent and its items, or by copying one item’s markup without its container.

How to fix it

Pick your stack. Review every change before you ship it.

Before

<div class="tabs">
  <button role="tab" aria-selected="true">Details</button>
</div>

After

<div class="tabs" role="tablist" aria-label="Product information">
  <button role="tab" aria-selected="true">Details</button>
</div>

Check it by hand too

Move through the widget with a screen reader on. Items should be announced with their position, such as “Medium, option, 2 of 4”.

Automated checks find a large share of accessibility problems, but not all of them. Passing this check does not on its own make a page compliant.

WCAG reference