Skip to content

fix(theme): do not show tab content when tabbing over it; show after selection only#8161

Merged
slorber merged 1 commit into
facebook:mainfrom
mturoci:fix/issue-8063
Oct 5, 2022
Merged

fix(theme): do not show tab content when tabbing over it; show after selection only#8161
slorber merged 1 commit into
facebook:mainfrom
mturoci:fix/issue-8063

Conversation

@mturoci

@mturoci mturoci commented Oct 2, 2022

Copy link
Copy Markdown
Contributor

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

netlify Bot commented Oct 2, 2022

Copy link
Copy Markdown

[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

github-actions Bot commented Oct 2, 2022

Copy link
Copy Markdown

⚡️ 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

mturoci commented Oct 2, 2022

Copy link
Copy Markdown
Contributor Author

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

@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

mturoci commented Oct 5, 2022

Copy link
Copy Markdown
Contributor Author

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

@slorber

slorber commented Oct 5, 2022

Copy link
Copy Markdown
Collaborator

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

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