Repository navigation
Hide ScrollView and ActivityIndicator content when aria-hidden is set - #59072
Draft
YevheniiKotyrlo wants to merge 1 commit into
Draft
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
ScrollView and ActivityIndicator hand their props to a native component without the translation View applies, so aria-hidden reached the native side as a prop it does not read and the content stayed visible to TalkBack and VoiceOver. ScrollView now maps it to importantForAccessibility="no-hide-descendants" and accessibilityElementsHidden, as View does, and ActivityIndicator passes it to the View that wraps its indicator. RNTester's aria-hidden example gains a ScrollView and an ActivityIndicator.
Contributor
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary:
ScrollViewandActivityIndicatorhand their props to a native component without the translationViewgivesaria-hidden, so the native side gets a prop it does not read and their content stays reachable by TalkBack and VoiceOver. #53364 closed the same gap forText,TextInputandImage.ScrollViewnow mapsaria-hiddentoimportantForAccessibility="no-hide-descendants"andaccessibilityElementsHidden, asViewdoes.ActivityIndicatorhands it to theViewthat wraps its indicator, which applies the same mapping. RNTester's aria-hidden example gains aScrollViewand anActivityIndicator.Left out:
Switch, which takes keyboard focus;RefreshControl, which on Android wraps its scroll view, so hiding it would hide the scrolled content there and not on iOS;DrawerLayoutAndroidandProgressBarAndroid, which are deprecated.Changelog:
[GENERAL] [FIXED] -
aria-hiddensupport forScrollViewandActivityIndicatorTest Plan:
ScrollView-itest.jsandActivityIndicator-itest.js. Without the change the two mapping cases fail, the host rendering noimportantForAccessibility; with ityarn fantom ScrollView ActivityIndicator-itest View-itestpasses 329 tests in 8 suites. Run inreactnativecommunity/react-native-android:latest, the imagebuild_fantom_runneruses.yarn lint,yarn flow-check,yarn format-check-javascript,yarn test-ci(244 suites),yarn build-types(no change to the generated types) andyarn test-generated-typescriptpass in the same image.Viewuses.