feat: add support for splitting focus on nested views of iOS #29142
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
This PR #27855 allows nested views like illustration shows below to obtain three focus when accessibilitySplitFocus is set on the parent view.
This PR aims to make accessibility focus acts as consistent with that on Android for these nested views.
When touch point is inside of the inner element, the corresponding inner element would be activated other than the outer one.
If a merged focus is needed, just don't set it or set accessibilitySplitFocus to false.
Changelog
[iOS][Added] - Added accessibilitySplitFocus prop to support focus capturing of subviews of nested views.
Test Plan
[1] Run RNTester
[2] Go to the "AccessibilityIOS" page
[3] Toggle VoiceOver in settings.
[4] When accessibilitySplitFocus is not set:
[4-1] Touch on the "First Inner Element", only get the merged focus(outer one)
[4-2] Touch on the "Second Inner Element", get the merged focus as well
[5] When accessibilitySplitFocus is set:
[5-1] Touch on the "First Inner Element", get focus of the first inner element
[5-2] Touch on the "Second Inner Element", get focus of the second one
[5-3] Touch on the space out of two inner elements but inside the outer element, get the merged focus