Skip to content

fix: disable screen readers on stacked transparentModal screens for improved accessibility #12541

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
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

theonetheycallneo
Copy link

@theonetheycallneo theonetheycallneo commented Apr 9, 2025

Motivation

Web screen readers can see the components on the previous underlying screens.
I noticed we already do this for iOS and Android via:

accessibilityElementsHidden={!focused}
importantForAccessibility={focused ? 'auto' : 'no-hide-descendants'}

So, simply adding the 3rd aria-hidden to improve web acessibility.

Test plan

  1. Create 2 screens, 1 normal and 1 with presentation: transparentModal
  • first screen should have 1+ text component(s)
  • screen 2 can be anything simple
  1. Open the transparentModal screen from the previous screen
  2. Enable screen reader/voice over
  3. Note: The elements on the 2nd screen are no longer visible by the screen reader

Related:
necolas/react-native-web#2773

Copy link

github-actions bot commented Apr 9, 2025

Hey @theonetheycallneo! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.

Copy link

netlify bot commented Apr 9, 2025

Deploy Preview for react-navigation-example ready!

Name Link
🔨 Latest commit 2a70bf1
🔍 Latest deploy log https://app.netlify.com/sites/react-navigation-example/deploys/67fd6a6b8d8f370008b6d641
😎 Deploy Preview https://deploy-preview-12541--react-navigation-example.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 configuration.

@theonetheycallneo theonetheycallneo changed the title fix: Disable screen reading for stacked transparentModal screens for … fix: disable screen readers on stacked transparentModal screens for improved accessibility Apr 10, 2025
@satya164
Copy link
Member

Thanks for the PR. This is part of a larger effort to replace all a11y related props with aria props, which are now supported in React Native so that we can support all platforms with the samecode. However I haven't been able to finalize it: #11848

If you'd like to take over that PR, then feel free. The biggest part left is to test the changes to see if it works, and rebase the PR against latest changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants