8000 Accessibility bug when using a Stack with animation on web · Issue #12583 · react-navigation/react-navigation · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Accessibility bug when using a Stack with animation on web #12583

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

Open
3 of 13 tasks
mathias-berg opened this issue May 6, 2025 · 0 comments
Open
3 of 13 tasks

Accessibility bug when using a Stack with animation on web #12583

mathias-berg opened this issue May 6, 2025 · 0 comments

Comments

@mathias-berg
Copy link

Current behavior

When using a stack I would expect only the top most screen in the stack to be visible in the accessibility tree.
And it is, as long as you don't add an animation in screenOptions of the stack or options for the screen.

For this very simple set up with two screens (Home Screen and Details Screen) it looks like this when on the Details Screen:
Image

But as soon as I add animation, the previous screen will be listed in the accessibility tree.
Image

As you see in the image above the main element of the previous screen (Home Screen) is exposed and accessible from a screen reader and if you use the keyboard to tab to a focusable element.

There is also an warning in the console related to this:
Image

Expected behavior

The expected behaviour is that it should work the same way regardless if the animation is set or not.
The previous screen should not be accessible to a screen reader or you should not be able to keyboard tab to the previous screen.

A side note is that is also the same if I change the headerMode to float, then the previous header is also accessible from the current screen which it should not be.

This behaviour is not really reproducible on Snack. The previous screen is visible in the accessibility tree for a short moment and then is goes away. Why I don't know, but I will add a small repo that you can test this on and also the Snack link.
https://snack.expo.dev/@fyranollfyra/accessibility-bug

This behaviour started on version 7.2.1, 7.2.0 works fine. Not sure if the console warning was there on 7.2.1, but it is at the latest version tested at least.

Reproduction

https://github.com/mathias-berg/react-navigation-a11y-bug

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack
  • react-native-drawer-layout
  • react-native-tab-view

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/native 7.1.8
@react-navigation/stack 7.3.1
react-native-screens 4.10.0
react-native-safe-area-context 5.4.0
react-native-web 0.20.0
node 22.14.0
yarn 1.22.22
Electron 36.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0