Repository navigation
Hide ScrollView and ActivityIndicator content when aria-hidden is set - #59072
YevheniiKotyrlo wants to merge 1 commit into
Conversation
Device evidence — before / afterUNFIXED — with aria-hidden on, touching the text in the FIXED — the focus stays on the switch it was on.
RNTester debug builds of iOS — the accessibility tree, before / afterUNFIXED — the text in a FIXED — neither is, and with
RNTester's Release build from a newer |
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 the way TextInput and the touchables do.
ActivityIndicator hands it, with accessibilityElementsHidden, to the View
that wraps its indicator, so View's mapping decides both, and
aria-hidden={false} overrides an explicit accessibilityElementsHidden as
it does on View. RNTester's aria-hidden example gains a ScrollView and an
ActivityIndicator.
89d0562 to
a669d1b
Compare




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"andaccessibilityElementsHiddenthe wayTextInputand the touchables do.ActivityIndicatorhands it, withaccessibilityElementsHidden, to theViewthat wraps its indicator, soView's mapping decides both. On both components,aria-hidden={false}given withaccessibilityElementsHidden={true}exposes the content, as it does on aView. RNTester's aria-hidden example gains aScrollViewand anActivityIndicator.Left out:
Modal, whose content is shown in a window of its own rather than under its host view, andRefreshControl, which on Android wraps its scroll view, soaria-hiddenon it would hide the scrolled content on Android but not on iOS.#59379 overlaps this change: it maps
aria-hiddenon both components through a shared helper, together with the otheraria-*props, and onSwitch, which this change leaves alone. I'll close this one if #59379 is merged.Changelog:
[GENERAL] [FIXED] -
aria-hiddensupport forScrollViewandActivityIndicatorTest Plan:
ScrollView-itest.jsandActivityIndicator-itest.js. Without the change, each component's case that setsaria-hiddenand its case that removes it again fail; with it they pass, and so doesyarn fantomasrun_fantom_testsruns it (3284 tests). Run inreactnativecommunity/react-native-android:latest, the imagebuild_fantom_runneruses.lint(yarn lint,yarn flow-check),test_js(245 suites),build_js_types,format,build_androidandvalidate_cxx_api_snapshotsjobs pass.ScrollViewwitharia-hiddenand anActivityIndicatorwitharia-hiddenare in the tree, with it neither is. RNTester's unit tests on the same iPad: the five that fail onmainthere, fourRCTBundleURLProviderTeststhat expect a packager andRCTConvert_NSColorTests, fail the same way with the change, and no other test fails.The TalkBack screenshots and the iOS accessibility-tree table are in the comment below.