ARIA attributes are not used as specified for the element’s role
How to fix the aria-conditional-attr accessibility rule. ARIA.
The message you saw
Lighthouse runs axe-core inside it, so both are the same check, and the fix below works whichever tool showed you the message.
What it means
Some ARIA attributes are allowed on a role only in certain situations. This message means an attribute is on the right kind of element, but in a situation where the standard says not to use it.
axe checks two cases. First, a native <input type="checkbox"> or <input type="radio"> with an aria-checked that disagrees with its real checked state: the browser already knows the state, and the attribute contradicts it. Second, a table row with aria-expanded, aria-level, aria-posinset or aria-setsize inside a normal table or grid: those attributes only make sense on rows of a treegrid, where rows can be expanded and nested.
Who is affected
An ARIA attribute is used where its role doesn't allow it: aria-checked contradicting a real checkbox, or tree attributes like aria-expanded on a plain table row.
Screen-reader users can hear a checkbox announced as checked while it is unchecked (or the other way round), and press it based on the wrong information. In tables, they may hear expand and level information that doesn’t match anything they can do.
How to find it
- Run the checker on the page: the report says which attribute is the problem and why.
- Search for
aria-checkedon<input>elements, and foraria-expandedoraria-levelon<tr>orrole="row".
How to fix it
- On native checkboxes and radio buttons, remove
aria-checked. Use thecheckedproperty (andindeterminatefor a mixed state); the browser reports it correctly. - On table rows, remove the tree attributes. If your rows really expand and collapse into child rows, build the table as a
treegrid(with its keyboard behaviour) so the attributes are allowed. - If only a button inside the row expands something, put
aria-expandedon that button instead of on the row.
Examples
A native checkbox
Before
<input type="checkbox" aria-checked="true" id="terms">
<label for="terms">I accept the terms</label>After
<input type="checkbox" checked id="terms">
<label for="terms">I accept the terms</label>An expandable row in a normal table
Before
<table>
<tr aria-expanded="false">
<td>Order 1042</td>
<td><button>Details</button></td>
</tr>
</table>After
<table>
<tr>
<td>Order 1042</td>
<td><button aria-expanded="false" aria-controls="o1042">Details</button></td>
</tr>
</table>WCAG success criteria
When this rule fails, the page fails:
- 4.1.2 Name, Role, Value (Level A, WCAG 2.0, 2.1, 2.2)
Check your fix
Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools. Scan again after your change: when the rule no longer appears under the problems, the fix worked.
An automated pass means this rule found nothing wrong. It doesn’t prove the page is accessible: some of what WCAG asks for needs a person to check, and the report’s manual checklist lists those steps.
Related fix guides
[aria-*]attributes do not match their roles- Elements use prohibited ARIA attributes
[aria-*]attributes do not have valid values<th>elements and elements with[role="columnheader"/"rowheader"]do not have data cells they describe
More detail
- Deque University’s reference for aria-conditional-attr (the makers of axe-core, the engine our scanner uses)
- W3C’s Understanding 4.1.2
- All fix guides