[Accessibility] Expose the implementation for setting accessibility focus programmatically on iOS. Also, expose .focus() API for RX.Button.#90
Merged
berickson1 merged 3 commits intomicrosoft:masterfrom May 15, 2017
Conversation
|
@eulphean, |
berickson1
requested changes
May 12, 2017
src/ios/AccessibilityUtil.ts
Outdated
| export class AccessibilityUtil extends AccessibilityPlatformUtil { | ||
| setAccessibilityFocus(component: React.Component<any, any>): void { | ||
| // NO-OP | ||
| if (RN.AccessibilityInfo && Accessibility.isScreenReaderEnabled()) { |
Collaborator
There was a problem hiding this comment.
Should you ensure RN.AccessibilityInfo.setAccessibilityFocus is defined, so this doens't crash on versions of RN without this API?
Collaborator
There was a problem hiding this comment.
You can merge these two checks
berickson1
requested changes
May 12, 2017
src/ios/Accessibility.ts
Outdated
| @@ -63,7 +63,9 @@ export class Accessibility extends NativeAccessibility { | |||
|
|
|||
| // Some versions of RN don't support this interface. | |||
| if (RN.AccessibilityInfo) { | |||
Collaborator
There was a problem hiding this comment.
merge the two if blocks
src/ios/AccessibilityUtil.ts
Outdated
| export class AccessibilityUtil extends AccessibilityPlatformUtil { | ||
| setAccessibilityFocus(component: React.Component<any, any>): void { | ||
| // NO-OP | ||
| if (RN.AccessibilityInfo && Accessibility.isScreenReaderEnabled()) { |
Collaborator
There was a problem hiding this comment.
You can merge these two checks
added 3 commits
May 15, 2017 11:22
…ocus programmatically on iOS. Also, expose .focus() API for RX.Button.
berickson1
approved these changes
May 15, 2017
berickson1
pushed a commit
to berickson1/reactxp
that referenced
this pull request
Oct 22, 2018
…ocus programmatically on iOS. Also, expose .focus() API for RX.Button. (microsoft#90) * [Accessibility] Expose the implementation for setting accessibility focus programmatically on iOS. Also, expose .focus() API for RX.Button.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change enables the react-native work to programmatically set accessibility focus for iOS. Since that change will take some time to be contributed back to open source React-Native, this API will not work as expected.
This change also exposes the .focus() behavior for RX.Button.