Repository navigation
fix(View): map aria-modal to accessibilityViewIsModal - #59328
faciledictu wants to merge 1 commit into
Conversation
|
Hi @faciledictu! 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! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
@javache has imported this pull request. If you are a Meta employee, you can view this in D126904378. |
Summary:
The
Viewdocs listaria-modalas an iOS prop that "has precedence over theaccessibilityViewIsModalprop".Viewdoes not map it, though:View.jsconverts
aria-label,aria-live,aria-hiddenand the otheraria-*propsto their
accessibility*forms, butaria-modalis passed through unchanged,and the native side only reads
accessibilityViewIsModal. As a result<View aria-modal>does nothing, and VoiceOver can still reach the viewsbehind a custom dialog.
When
aria-modalwas added in #34506, it was mapped inPressableand theTouchable*components and added toViewPropTypes, butView.jsitself wasnot changed, so the prop is typed and documented on
Viewbut has no effectthere.
This change maps
aria-modaltoaccessibilityViewIsModalinView, witharia-modaltaking precedence, as documented.Changelog:
[IOS] [FIXED] -
aria-modalonViewnow setsaccessibilityViewIsModalTest Plan:
Checked on an iPhone (iOS 27) with React Native 0.88.0 (Expo SDK 58,
development build), VoiceOver on. A screen with three background buttons and a
custom overlay that is their sibling:
Before: with the dialog open, swiping right goes past "Close" to the
"Background item" buttons, and touching where they are focuses them.
Replacing
aria-modalwithaccessibilityViewIsModalkeeps focus inside thedialog.
After:
aria-modalbehaves the same asaccessibilityViewIsModal.