These docs are for CORA 0.10, an older release. Read this page in the newest docs.
Roles need to be current, not deprecated
- Rule:
axe/aria-deprecated-role - Checks: Deprecated ARIA roles must not be used
- WCAG: 4.1.2
- Fix class:
mechanical: A fix needs no authored text or visual decision.
Who it affects
Section titled “Who it affects”- People who use a screen reader or a braille display, most of them blind.
How to fix it
Section titled “How to fix it”An element has role="directory"
Section titled “An element has role="directory"”Use a list instead: <ul> or <ol> with <li> items, or role="list" and role="listitem" where native lists cannot be used. ARIA deprecated directory because assistive technology exposes it as a plain list anyway.
<nav aria-label="On this page"> <ul> <li><a href="#setup">Setup</a></li> <li><a href="#usage">Usage</a></li> </ul></nav>An element has role="doc-biblioentry" or role="doc-endnote"
Section titled “An element has role="doc-biblioentry" or role="doc-endnote"”Remove the role and make each entry a list item inside the doc-bibliography or doc-endnotes section. The section role already says what the items are, and the list gives people the count.
<section role="doc-endnotes" aria-labelledby="notes-heading"> <h2 id="notes-heading">Notes</h2> <ol> <li id="note-1">First published in 1998.</li> <li id="note-2">Revised for the second edition.</li> </ol></section>Fixes that fail
Section titled “Fixes that fail”Deleting the role without restoring a list
Section titled “Deleting the role without restoring a list”Entries left as loose <p> or <div> elements lose the item count and boundaries that a list gives screen reader users.
More on the rule
Section titled “More on the rule”axe-core’s documentation of the rule
CORA’s fix guidance adapts content from accessibility-agents, under the MIT License: see its notice.