Skip to content

Add support for aria-hidden/accessibilityElementsHidden prop. #14560

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

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

satkh
Copy link

@satkh satkh commented Apr 17, 2025

Description

Type of Change

  • New feature (non-breaking change which adds functionality)

Why

Add support for aria-hidden/accessibilityElementsHidden prop.

Resolves #14541

What

accessibilityElementsHidden is a boolean property that when set to true, the view is hidden from the accessibility tree.
As per the docuementation AccessibilityElementsHidden , should be same as importantForAccessibility == "no-hide-descendants"
Setting accessibilityElementsHidden to true will hide the view and its children from the accessibility tree.

Screenshots

Testing

AccessibilityElementsHidden_1.mp4
AccessibilityElementsHidden_3.mp4

Optional: Describe the tests that you ran locally to verify your changes.

Changelog

Should this change be included in the release notes: indicate yes or no

Add a brief summary of the change to use in the release notes for the next release.

Microsoft Reviewers: Open in CodeFlow

@satkh satkh requested a review from chiaramooney April 17, 2025 05:55
@chiaramooney
Copy link
Contributor

@acoates-ms I recall you mentioning that our original implementation of importantForAccessibility was inefficient/caused a lot of rerendering. This implementation of accessibilityElementHidden would match the current importantForAccessibility. Should this PR be merged, assuming we still need to go back and make this code better? Or should we hold off merging until we have a new, more efficient implementation for importantForAccessibility and accessibilityElementHidden?

@acoates-ms
Copy link
Collaborator

acoates-ms commented Apr 17, 2025

@acoates-ms I recall you mentioning that our original implementation of importantForAccessibility was inefficient/caused a lot of rerendering. This implementation of accessibilityElementHidden would match the current importantForAccessibility. Should this PR be merged, assuming we still need to go back and make this code better? Or should we hold off merging until we have a new, more efficient implementation for importantForAccessibility and accessibilityElementHidden?

Yeah, we should really replace the JS implementation of importantForAccessibility with a native one - at least in fabric.
We should modify the JS to only remove the tree when running in paper. And then implement importantForAccessibility in our automationproviders for fabric.

The JS implementation of this property also caused all kinds of issues for people - including breaking / issues for rn-navigation.

@TatianaKapos
Copy link
Contributor

@satkh RNW setup is a little different than other repos, we want to keep our branches clean to not clutter up the stable branches. PRs should come from your own forked repository of the react-native-windows repo, see https://github.com/microsoft/react-native-windows/blob/main/docs/contributing.md for more information! I think @Yajur-Grover also recorded some videos on how to do so!

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.

Add support for aria-hidden prop.
4 participants