Skip to content

Conversation

@AKB48
Copy link
Contributor

@AKB48 AKB48 commented Jun 15, 2020

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.

 ---------------------
|   Outer Element  <--|---focus 1
|                     |
|  --------------- 
| | Inner Element |<--|---focus 2
|  ---------------    |
|  ---------------    |
| | Inner Element |<--|---focus 3
|  ---------------    |
|                     |
 ---------------------

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

* feat: add support for splitting focus on nested views of iOS
@AKB48 AKB48 requested a review from shergin as a code owner June 15, 2020 12:49
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 15, 2020
@react-native-bot react-native-bot added Platform: iOS iOS applications. Type: Enhancement A new feature or enhancement of an existing feature. labels Jun 15, 2020
@analysis-bot
Copy link

analysis-bot commented Jun 15, 2020

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 6,762,741 -382
android hermes armeabi-v7a 6,425,668 -246
android hermes x86 7,149,225 -204
android hermes x86_64 7,039,125 -236
android jsc arm64-v8a 8,936,107 -398
android jsc armeabi-v7a 8,591,411 -263
android jsc x86 8,765,713 -221
android jsc x86_64 9,341,247 -268

Base commit: 56689e9

@analysis-bot
Copy link

analysis-bot commented Jun 15, 2020

Platform Engine Arch Size (bytes) Diff
ios - universal 10,786,272 9,956,832

Base commit: 56689e9

@AKB48 AKB48 closed this Jan 21, 2022
@AKB48 AKB48 deleted the master branch January 21, 2022 07:56
@AKB48 AKB48 restored the master branch January 21, 2022 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Platform: iOS iOS applications. Type: Enhancement A new feature or enhancement of an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants