[iOS] Announce "collapsed" for aria-expanded={false} on New Architecture - #58755
kimseongchan0914 wants to merge 1 commit into
Conversation
RCTViewComponentView only added the "expanded" accessibility value when expanded was true, so VoiceOver announced no state for aria-expanded={false}. The old-architecture RCTView announced both states. Add the missing branch, reusing the existing localized "collapsed" string.
Fixes react#58746
|
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary:
Fixes #58746.
On iOS with the New Architecture, VoiceOver announces no state for an element with
aria-expanded={false}(oraccessibilityState={{expanded: false}}). For example, a collapsed accordion header is read as "Returns, button", so a VoiceOver user can't tell it apart from an ordinary button.RCTViewComponentViewadded the "expanded" accessibility value only whenexpandedwastrue. There was no branch forfalse. The old-architectureRCTViewannounces both "expanded" and "collapsed", so this is a regression on the New Architecture.This change adds the missing branch. It reuses the localized "collapsed" string that
RCTView.malready uses. Whenexpandedis unset, no state is added, as before.Changelog:
[IOS] [FIXED] - VoiceOver now announces "collapsed" for
aria-expanded={false}on the New ArchitectureTest Plan:
Ran:
npx clang-formatonRCTViewComponentView.mmproduced no diffgit diff --check HEAD~1 HEADwas cleanNot run yet: an iOS build and a VoiceOver check on device. The expected VoiceOver output for
<Pressable role="button" aria-expanded={...}>in RNTester (New Architecture) is:aria-expandedfalsetrue🤖 Generated with Claude Code