role-takes-no-name
This fails the run. Where it is wrong about your code, // ramonda-check-ignore <reason> on the line says so, and the reason is printed on every run.
Reported when an aria-label or aria-labelledby is written on a role the specification forbids naming.
An aria-label is the accessible NAME of something in the accessibility tree, and the
specification says which roles may have one. A <div> is generic — the role for an element
that carries no meaning — so there is nothing for a name to name, and role="presentation"
is stronger still: it removes the element from the tree altogether.
The attribute is still in the DOM and still visible in the inspector. A screen reader announces the children exactly as it would have without it.
The intent is almost always a landmark or a group, so the fix is usually one word: give the
element the role it was meant to have — region, group, navigation — or write the
element that already has it. <section aria-label="Filters"> is a named region and is
correct; <nav aria-label="Breadcrumb"> is how two navs are told apart.
A written role always wins over the tag's own, so an element you have given a real role is
never reported.
Next
- All rules — the other checks this one runs beside.
- Checking your app — how to run it, and what it proves.