Skip to content

fix: theme switch button issue - #8569

Closed
proke03 wants to merge 1 commit into
meta:mainfrom
proke03:fix/theme-switch-button
Closed

proke03 wants to merge 1 commit into
meta:mainfrom
proke03:fix/theme-switch-button

Conversation

@proke03

@proke03 proke03 commented Jan 22, 2023 •

Copy link
Copy Markdown

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Test Plan

When the enter key was pressed with the theme change button selected, screen reader reads it five times.
There were two reasons for this problem.
First, the button tag had both title and aria-label.
Because the aria live region responds to either text content or aria-label changes, it will respond twice more if both are present.
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-relevant
Second, aria-live="polite".

Before fixed
https://user-images.githubusercontent.com/19148682/213901656-ad523fc9-8352-4569-b282-2e31593b348e.mp4

Move title to outter div
https://user-images.githubusercontent.com/19148682/213901679-511f025d-c36e-438f-84f3-71459a93b48f.mp4

Remove aria-live="polite"
https://user-images.githubusercontent.com/19148682/213901697-171e8db5-1167-4cbc-9b66-bb0cda08b6af.mp4

Test links

https://deploy-preview-8569--docusaurus-2.netlify.app/

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

#7667

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 22, 2023
@netlify

netlify Bot commented Jan 22, 2023

Copy link
Copy Markdown

✅ [V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 53e9bf7
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/63ccc217db0c87000baef543
😎 Deploy Preview https://deploy-preview-8569--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions

Copy link
Copy Markdown

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 77 🟢 97 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟠 82 🟢 100 🟢 100 🟢 100 🟢 90 Report

@slorber

slorber commented Jan 25, 2023

Copy link
Copy Markdown
Collaborator

Thanks

Is it a bad practice to have both title + aria-label? There are multiple places afaik we do that and not sure why tts would read this label twice 🤔 Any ref material to back this up?


aria-live polite was added for a good reason, although it likely lead to reading too much.

Are we sure this PR doesn't revert the fix we made (where initially it didn't always announce).

See my comment here: #8174 (comment)

@slorber slorber added domain: a11y Related to accessibility concerns of the default theme pr: bug fix This PR fixes a bug in a past release. labels Jan 25, 2023
@slorber

slorber commented Jan 25, 2023

Copy link
Copy Markdown
Collaborator

Would appreciate it if skilled a11y devs can help figure out if this is an improvement or not 😄

cc @BenDMyers @JoshuaKGoldberg @zmrhaljiri @timveld

@proke03

proke03 commented Jan 25, 2023

Copy link
Copy Markdown
Author

Thanks for your comment.

Maybe it's a bug in nvda.
nvaccess/nvda#10548

The exact cause cannot be determined. However, in the test link, both nvda and screen reader work well.

@slorber

slorber commented Jul 31, 2025

Copy link
Copy Markdown
Collaborator

I think we have fixed this already

@slorber slorber closed this Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA domain: a11y Related to accessibility concerns of the default theme pr: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants