docusaurus icon indicating copy to clipboard operation
docusaurus copied to clipboard

A11y: Tabs select when navigating with VoiceOver

Open backwardok opened this issue 3 years ago • 4 comments

Have you read the Contributing Guidelines on issues?

Prerequisites

  • [X] 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

When using VoiceOver on either iOS or macOS, navigating forward activates the next tab. This makes it difficult to access the actual tab panel content of a given tab.

Reproducible demo

https://docusaurus.io/docs/markdown-features/tabs

Steps to reproduce

For iOS VoiceOver:

  1. Turn on VoiceOver
  2. Open a page with the Tabs component
  3. Swipe right through the content to get to the tabs
  4. Swipe right through the tabs

macOS VoiceOver has the same steps, but replace "Swipe right" with "Press VO (control + option) + right arrow"

Expected behavior

User can navigate through the tabs to read through the tabs to activate or navigate forward to the tab panel content. The tab has to be activated by the user before it switches. This behavior works as expected on the ARIA authoring practices guide example for automatic tabs.

Actual behavior

When navigating with VoiceOver on, the tab switches automatically when reading through the tabs. Navigating with VoiceOver will move focus when it moves to a focusable element. But, because the Tabs code triggers a tab change on tab focus, this results in the tab also activating when reading the new tab.

Example of behavior on the ARIA example site, where I'm navigating around and the tab panel doesn't change until I select it: Set of 4 tabs and a tab panel with first tab selected. VoiceOver outline on tabs moves to later tabs and a keyboard focus ring also appears around the tab, but the selected tab remains on the first tab. Selecting a tab then changes the tab panel content.

Example of behavior on the Docusaurus site, where navigating around also selects the tab and updates the tab panel: Set of 3 tabs and a tab panel with the first tab selected and VoiceOver outline on the first tab. As VoiceOver outline moves to other tabs, the tab gets selected and the tab panel also changes.

Your environment

  • Public source code: https://github.com/facebook/docusaurus/blob/main/website/docs/guides/markdown-features/markdown-features-tabs.mdx
  • Public site URL: https://docusaurus.io/docs/markdown-features/tabs
  • Docusaurus version used: 2.1.0
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Safari 15.6.1
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): iOS 15.6.1 and macOS 12.5.1

Self-service

  • [ ] I'd be willing to fix this bug myself.

backwardok avatar Sep 08 '22 02:09 backwardok

I think tab presses should definitely switch focus between tab headings instead of jumping directly to the content afterward.

Josh-Cena avatar Sep 08 '22 02:09 Josh-Cena

Hi @Josh-Cena! The issue isn't with the tab press behavior, it's with the navigation behavior (browsing/reading content). The behavior currently where the tabs are a single (keyboard) tab stop and tabbing forward skips the rest of the tabs is expected and matches with the documented pattern behavior for tabs. The behavior that's an issue here is that browsing through the content is triggering the tab to activate because of the way focus handling is done on the component.

backwardok avatar Sep 08 '22 03:09 backwardok

Ah! I've never used VO + right arrow before, so I don't know what it does. (I'm not an expert on VoiceOver anyway.) Well in any case, let's see how this can be fixed.

Josh-Cena avatar Sep 08 '22 03:09 Josh-Cena

@Josh-Cena I've worked on a similar issue. Let me try resolving it. Thanks

noobyogi0010 avatar Sep 11 '22 18:09 noobyogi0010

Good first issue

This issue should be relatively easy to solve so I'm willing to delegate it to an external contributor looking to contribute.

Disclaimer

We, project maintainers, have limited time and need to protect it.

We kindly ask you to invest your time, trying to be autonomous and proactive instead of expecting us to guide you step-by-step.

  • Don't expect us to teach you the basics of Docusaurus: if you want to contribute, you have to get familiar with the project first, reading the official doc
  • Don't claim the issue and then ghost us (like it often happens)
  • Please at least submit a PR, and only then we assign the issue to you
  • Don't ask for advice even before giving it a try and submitting a failing PR
  • Maybe it's not a good issue for you, and you should simply move on

slorber avatar Sep 29 '22 17:09 slorber