Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headings are read twice by VoiceOver #9222

Open
2 of 7 tasks
unindented opened this issue Aug 13, 2023 · 5 comments
Open
2 of 7 tasks

Headings are read twice by VoiceOver #9222

unindented opened this issue Aug 13, 2023 · 5 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: a11y Related to accessibility concerns of the default theme

Comments

@unindented
Copy link

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

On macOS, the VoiceOver screen reader reads all headings twice, which is very annoying.

Here's a recording using Safari + VoiceOver:

docusaurus_safari_voiceover.mp4

And here's a recording using Chrome + VoiceOver:

docusaurus_chrome_voiceover.mp4

Reproducible demo

No response

Steps to reproduce

  1. Go to https://docusaurus.io/docs
  2. Activate VoiceOver with Cmd + F5
  3. Press <leader> + A (usually Ctrl + Alt + A)

Expected behavior

I'd expect each heading to only be read once.

Actual behavior

Each heading is read twice.

Your environment

Official Docusaurus website.

Self-service

  • I'd be willing to fix this bug myself.
@unindented unindented added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 13, 2023
@slorber
Copy link
Collaborator

slorber commented Aug 17, 2023

Hey

I'm not an accessibility expert, do you have any idea why this happens?

We did some accessibility changes to the headings here: #8336

cc @zmrhaljiri

@slorber slorber added domain: a11y Related to accessibility concerns of the default theme and removed status: needs triage This issue has not been triaged by maintainers labels Aug 17, 2023
@unindented
Copy link
Author

I'm no expert either, but I've noticed that headings on MDN don't have that problem.

The a11y trees look slightly different. Here's Docusaurus (heading name === static text + link name) :

Screenshot 2023-08-17 at 06 35 07

And here's MDN (heading === link name === static text):

Screenshot 2023-08-17 at 06 38 48

@thats-sarthak
Copy link

Is this issue open ?? If yes please assign me

@Josh-Cena
Copy link
Collaborator

Please stop asking for issues. We don't assign people. If you want to contribute, just send a PR.

@srapilly
Copy link

Heading links have an accessible name of "Direct link to [Heading title]", each link is inside the heading, so the accessible name of each heading for assistive technologies will concatenate the heading name and link name.

I think we could just put the link after the heading in the DOM as a first step(it's still quite verbose) On the MDN website, they just make the heading text as a link which could be a solution, but this makes it harder to select the heading text.

Nice article that explains different solutions with their pros and cons https://amberwilson.co.uk/blog/are-your-anchor-links-accessible/ and related GitHub issue valeriangalliat/markdown-it-anchor#82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: a11y Related to accessibility concerns of the default theme
Projects
None yet
Development

No branches or pull requests

5 participants