facebook/Docusaurus

Accessibility: docs sidebar: superfluous logo and <aside>

Open

#8 429 ouverte le 12 déc. 2022

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)JavaScript (1 074 forks)batch import
bugdomain: a11yhelp wanted

Métriques du dépôt

Stars
 (12 167 stars)
Métriques de merge PR
 (Merge moyen 14j 13h) (55 PRs mergées en 30 j)

Description

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

The pseudocode of the docs sidebar (docusaurus website) is: <aside> [docusaurus logo with tabindex -1] <nav aria-label=docs sidebar> ... </nav> <collapse sidebar button] </aside> The effect on the NVDA screen reader is that it reads: "complementary landmark [Docusaurus logo] docs side navigation landmark ..."

First, the logo (if it has tabindex -1 and is not visually present) should not be there, or should be aria-hidden.

Second, the aside element is superfluous. IMO the whole navigation bar incl logo and collapse button should be contained within a single <nav aria-label="docs sidebar"> element. Putting an additional region around it only clutters the page. Using <aside> for a navigational sidebar is not common and semantically dubious. Plus, the <nav> describes the goal of the region much more precisely than <aside>.

Reproducible demo

No response

Steps to reproduce

Inspect code of a docusaurus page with docs navigation sidebar

Expected behavior

Pseudocode should be: <nav aria-label="docs sidebar">[logo, but only if it is visually present and focusable; aria-hidden otherwise] ... [collapse sidebar button] </nav>

Actual behavior

pseudocode is: <aside> [docusaurus logo with tabindex -1] <nav aria-label="docs sidebar"> ... </nav> [collapse sidebar button] </aside>

Your environment

No response

Self-service

  • I'd be willing to fix this bug myself.

Guide contributeur