diff --git a/assets/js/theme/design-system/toc.js b/assets/js/theme/design-system/toc.js index e6db37102963c741595401a3cbf502568fa22d9d..be65283b7c93bf9ba4db902487077261c307af27 100644 --- a/assets/js/theme/design-system/toc.js +++ b/assets/js/theme/design-system/toc.js @@ -116,11 +116,13 @@ class TableOfContents { this.links.forEach((link) => { if (link === currentLink) { link.classList.add(CLASSES.linkActive); + link.setAttribute('aria-current', 'true'); this.updateCtaTitle(link); this.state.id = id; this.state.currentLink = link; } else { - link.classList.remove(CLASSES.linkActive) + link.classList.remove(CLASSES.linkActive); + link.removeAttribute('aria-current'); } }); } diff --git a/layouts/partials/toc/container.html b/layouts/partials/toc/container.html index 255253d1307bb3c4ca73b33126450c999fa206f9..8cb67b92870b4d6a34652320952809ae1aa85733 100644 --- a/layouts/partials/toc/container.html +++ b/layouts/partials/toc/container.html @@ -6,7 +6,7 @@ <div class="toc-container" aria-hidden="false" aria-labelledby="toc-title"> <div class="toc-content"> {{/* TODO : quelle balise pour le titre du toc ? */}} - <div id="toc-title" class="toc-title">{{ i18n "commons.toc" }}</div> + <div id="toc-title" class="toc-title" role="heading">{{ i18n "commons.toc" }}</div> {{- partial (printf .toc) . -}} <button name="{{ i18n "commons.close" }}">{{ i18n "commons.close" }}</button> </div>