Skip to content

feat(accessibility): add inert to forwardedProps #2773

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 1 commit into
base: master
Choose a base branch
from

Conversation

theonetheycallneo
Copy link

@theonetheycallneo theonetheycallneo commented Apr 15, 2025

One thing we found working on the accessibility of our components is that simply putting aria-hidden on a parent element on web is problematic. If you have certain elements inside of this component like text inputs, the browser will log errors if you put aria-hidden on a parent element without it also being on all the individual children.

You have to put the inert attribute on the parent to actually hide the entire tree of children from the screen reader properly.

Inert reference:
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inert

This will help trap and disable underneath components with other libraries like navigation:
react-navigation/react-navigation#12541

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 15e7505:

Sandbox Source
react-native-web-examples Configuration

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

Successfully merging this pull request may close these issues.

1 participant