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

fix: theme switch button issue #8569

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

proke03
Copy link

@proke03 proke03 commented Jan 22, 2023

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
Copy link

netlify bot commented Jan 22, 2023

[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

⚡️ 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
Copy link
Collaborator

slorber commented Jan 25, 2023

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
Copy link
Collaborator

slorber commented Jan 25, 2023

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

cc @BenDMyers @JoshuaKGoldberg @zmrhaljiri @timveld

@proke03
Copy link
Author

proke03 commented Jan 25, 2023

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.

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