aria-text

role="text" elements should have no focusable descendants

manualconfidence: mediumseverity: minorrobust

Checks that elements with role="text" contain no focusable descendant (link, button, form control, tabindex, iframe, or contenteditable).

Applies to. Elements with an explicit `role="text"`.

Expectation. `role="text"` tells assistive technology to treat an element's whole subtree as a single unit of plain text (e.g. text visually split across multiple `<span>`s by styling). Per the WAI-ARIA Authoring Practices, this only makes sense when that subtree contains no focusable content: a focusable descendant inside a "this is just text" region is unreachable or confusing for keyboard/AT users.

Examples

can't tell
<span role="text">Some text with <a href="#">a link</a> inside it.</span>

`role="text"` tells assistive technology to treat this as a single flat string, but the nested link is still focusable and interactive underneath it.

n/a
<span role="text">Plain text with no interactive content.</span>

No focusable descendant exists inside the `role="text"` element.

View source