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): do not show tab content when tabbing over it; show after selection only #8161

Merged
merged 1 commit into from Oct 5, 2022

Conversation

mturoci
Copy link
Contributor

@mturoci mturoci commented Oct 2, 2022

Motivation

Improve a11y for Tabs component.

Test plan

manual - Voiceover on MacOS.

Screen.Recording.2022-10-02.at.9.53.34.AM.mov

Tab content is only shown after selection (hitting enter).

Compare:

Related issues

Closes #8063

@facebook-github-bot
Copy link
Contributor

Hi @mturoci!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@netlify
Copy link

netlify bot commented Oct 2, 2022

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit edda4bb
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6339452cabfdf80008ff2edd
😎 Deploy Preview https://deploy-preview-8161--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

github-actions bot commented Oct 2, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 66 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 71 🟢 100 🟢 100 🟢 100 🟢 90 Report

@mturoci
Copy link
Contributor Author

mturoci commented Oct 2, 2022

I have signed the CLA:

image

But somehow the PR checks didn't run again. Any ideas on how to resolve this?

Edit: They ran, but some 2h later so all good.

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 2, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@mturoci mturoci changed the title fix: Do not show tab content when tabbing over it - show after selection only. #8063 fix(theme-classic): Do not show tab content when tabbing over it - show after selection only. #8063 Oct 2, 2022
@mturoci mturoci changed the title fix(theme-classic): Do not show tab content when tabbing over it - show after selection only. #8063 fix(theme-classic): do not show tab content when tabbing over it - show after selection only #8063 Oct 2, 2022
@Josh-Cena Josh-Cena changed the title fix(theme-classic): do not show tab content when tabbing over it - show after selection only #8063 fix(theme): do not show tab content when tabbing over it; show after selection only Oct 2, 2022
@Josh-Cena Josh-Cena added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Oct 2, 2022
@Josh-Cena
Copy link
Collaborator

@backwardok Could you take a look at https://deploy-preview-8161--docusaurus-2.netlify.app/docs/markdown-features/tabs/ and confirm if that's your desired UX?

@backwardok
Copy link

@Josh-Cena this looks good! There's a change in behavior for keyboard-only users, but with the focus outline I think this should still be understandable on how to activate the tabs.

@mturoci Thank you for fixing this!

@mturoci
Copy link
Contributor Author

mturoci commented Oct 5, 2022

Hi @Josh-Cena is there anything I can do to get this PR merged in? (e.g. any required code changes)

@slorber
Copy link
Collaborator

slorber commented Oct 5, 2022

Thanks @mturoci that looks to work as intended 👍

Was wondering, shouldn't we announce the tab content after selecting a new tab? similarly to aria-live used in #8174 ?

Let's handle that in a separate PR because I have no idea on which DOM element such attribute could be added 😅

@slorber slorber added the to backport This PR is planned to be backported to a stable version of Docusaurus label Oct 5, 2022
@slorber slorber merged commit b0d431a into facebook:main Oct 5, 2022
@backwardok
Copy link

Hi @slorber ! I wouldn't recommend announcing the tab content after selecting a new tab. As long as the user knows that the tab changed (which they should get from the change in aria-selected for the tab), they should know that the tab content should also have changed and access it when they want to.

@mturoci mturoci deleted the fix/issue-8063 branch October 6, 2022 07:15
slorber pushed a commit that referenced this pull request Oct 28, 2022
@slorber slorber added backported This PR has been backported to a stable version of Docusaurus and removed to backport This PR is planned to be backported to a stable version of Docusaurus labels Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR has been backported to a stable version of Docusaurus CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A11y: Tabs select when navigating with VoiceOver
5 participants