Fix "aria-hidden on <body>" in HTML
Why it's a problem
Setting aria-hidden="true" on <body> removes the ENTIRE page from assistive technologies. A screen reader announces nothing: the page is empty to it, while it displays normally on screen. A single mistake, but a total one.
How to fix it — HTML
Remove aria-hidden from <body>. The usual cause is a modal hiding the rest of the page: apply aria-hidden (or better, inert) to the main content container, never to <body>, which also contains the modal.
<!-- La modale est DANS body : elle disparaît aussi -->
<body aria-hidden="true">
<main>…</main>
<div role="dialog">…</div>
</body><body>
<main inert>…</main>
<div role="dialog" aria-modal="true">…</div>
</body>RGAA criterion 10.8 — Présentation de l’information
Pour chaque page web, les contenus cachés ont-ils vocation à être ignorés par les technologies d’assistance ?
How to check: official tests (in French)
Test 10.8.1
Dans chaque page web, chaque contenu caché vérifie-t-il une de ces conditions ?
Le contenu caché a vocation à être ignoré par les technologies d’assistance ;
Le contenu caché n’a pas vocation à être ignoré par les technologies d’assistance et est rendu restituable par les technologies d’assistance suite à une action de l’utilisateur réalisable au clavier ou par tout dispositif de pointage sur un élément précédent le contenu caché ou suite à un repositionnement du focus dessus.
Full page for criterion 10.8 · Official text: Référentiel général d'amélioration de l'accessibilité (RGAA) 4.1, DINUM, Licence Ouverte 2.0.
Check your site in 30 seconds
Conformly detects this kind of issue across all your pages, continuously, and alerts you on every regression.
Free scan