Focusable element inside a control with presentational children
aria/presentational-children-focusable
- WCAG success criterion
- 4.1.2 (level A)
- Outcome class
- Automatic. An automated check that can report a confirmed violation.
- Area
- Accessibility, Technical Robustness
- Default severity
- high
- axe-core rule
aria/presentational-children-focusable
Why we flag this
Keyboard users reach an element that screen readers do not announce.
Focusable descendant of button, checkbox, tab, menu item or another role whose children are presentational.
What the rule checks
Scope. Rendered elements whose role has presentational children (button, checkbox, img, math, menuitemcheckbox, menuitemradio, meter, option, progressbar, radio, scrollbar, separator, slider, switch, tab), explicit or native (button, option, progress, meter).
Expectation. Fails when such an element contains a focusable descendant (a link with href, an enabled form control, any element with a tabindex): its children are presentational, so the keyboard stops at the descendant while assistive technology gets no role or name for it. Reported once, at the outer element. Elements side by side pass; a disabled control is not focusable. Content under aria-hidden still takes keyboard focus and counts; content that is not rendered does not.
Source. WCAG 2.2 SC 4.1.2 Name, Role, Value and SC 1.3.1 Info and Relationships; WAI-ARIA 1.2 Children Presentational: True; ACT 307n5z
Detection: shared; needs dom.
Failing example
The check reports a violation here. Corpus case aria_presentation_conflict, element button#save. The page may contain further findings for other rules.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Your documents - Example cloud</title>
<style>
body { color: #111111; background: #ffffff; font-size: 16px; }
</style>
</head>
<body>
<header>
<a href="#main" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Skip to main content</a>
<p>Example cloud</p>
<nav aria-label="Main"><a href="#main" aria-current="page" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Overview</a></nav>
</header>
<main id="main">
<h1>Your documents</h1>
<!-- Marked as decorative, but a global ARIA attribute keeps it in the tree
(WAI-ARIA 1.2, Presentational Roles Conflict Resolution). -->
<div id="toolbar" role="presentation" aria-label="Document actions"><p>Three documents</p></div>
<!-- An empty alt maps to role presentation (HTML-AAM); aria-labelledby
brings it back. -->
<img id="logo" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="" aria-labelledby="logo-label" width="40" height="40"><span hidden id="logo-label">Example cloud logo</span>
<!-- Focusable: the presentation role does not apply. -->
<p><span id="more" role="none" tabindex="0">More documents</span></p>
<!-- Children of a button are presentational (Children Presentational: True);
the focusable span inside gets no role or name for a screen reader. -->
<button id="save" type="button">Save <span role="button" tabindex="0" aria-label="Save options">▼</span></button>
<!-- Same with an explicit role: the link inside a checkbox. -->
<p><span id="terms" role="checkbox" aria-checked="false" tabindex="0">I accept the <a href="/terms">terms of use</a></span></p>
</main>
<footer><p>Footer text</p></footer>
</body>
</html>Passing example
The check passes here and reports nothing. Corpus case aria_presentation_valid. The page may contain further findings for other rules.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Your documents - Example cloud</title>
<style>
body { color: #111111; background: #ffffff; font-size: 16px; }
</style>
</head>
<body>
<header>
<a href="#main" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Skip to main content</a>
<p>Example cloud</p>
<nav aria-label="Main"><a href="#main" aria-current="page" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Overview</a></nav>
</header>
<main id="main">
<h1>Your documents</h1>
<!-- Decorative image without any global ARIA attribute. -->
<img id="divider" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="" width="200" height="4">
<!-- The ARIA attribute sits on the child, not on the presentational element. -->
<div id="layout" role="presentation"><a href="/archive" aria-label="Archived documents">Archive</a></div>
<!-- Not in the accessibility tree: nothing to conflict with. -->
<img id="hidden-logo" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="" hidden aria-label="Example cloud logo" width="40" height="40">
<!-- Two buttons side by side instead of one inside the other. -->
<button id="save" type="button">Save</button>
<button id="save-options" type="button" aria-label="Save options">▼</button>
<!-- A checkbox whose content is only text. -->
<p><span id="terms" role="checkbox" aria-checked="false" tabindex="0">I accept the terms of use</span> <a href="/terms">Read the terms of use</a></p>
<!-- Not rendered: no keyboard stop inside. -->
<div hidden><span id="hidden-terms" role="checkbox" aria-checked="false" tabindex="0">I accept the <a href="/privacy">privacy policy</a></span></div>
</main>
<footer><p>Footer text</p></footer>
</body>
</html>This page is generated from the rule catalogue and the rule contracts; see therule overview for how the outcome classes are derived.