aria-text
role="text" elements should have no focusable descendants
Checks that elements with role="text" contain no focusable descendant (link, button, form control, tabindex, iframe, or contenteditable).
Applies to. Elements whose role attribute has the token text, matched in any case, before any token naming a WAI-ARIA role, so role="foo text" and role="TEXT" count while role="link text" (a link) does not.
Expectation. role="text" names no WAI-ARIA role (neither WAI-ARIA 1.2 nor the 1.3 draft defines it; aria-roles-valid reports it), but some assistive technology has read it as asking 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). That only makes sense when the subtree contains no focusable content: a focusable descendant inside a "this is just text" region is unreachable or confusing for keyboard/AT users.
Examples
<span role="text">Plain text with no interactive content.</span>
No focusable descendant exists inside the role="text" element.
<span role="text">Some text with <a href="#">a link</a> inside it.</span>
role="text" is meant to have the content read as a single flat string, but the nested link is still focusable and interactive underneath it.
How to check
When this rule can’t decide, it reports cantTell and leaves the question to a person. Each question it can ask is listed here under its reason code, with the steps to answer it. A finding carries the same steps as howToCheck, in the scan’s language. See Output schema.
ROLE_TEXT_HAS_FOCUSABLE_DESCENDANT
- Inspect the element the report names and find the focusable element inside it.
- Press Tab until that element has focus, with a screen reader running, and listen to what is announced.
- Try to activate it with Enter or Space.
Pass. The focusable element is announced with its role and name and can be used, or it doesn't need to be focusable.
Fail. The focusable element is announced as plain text, or not at all, so users can't tell it is interactive (best practice, WAI-ARIA Authoring Practices).