Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Accessibility] Expose the implementation for setting accessibility focus programmatically on iOS. Also, expose .focus() API for RX.Button. #90

Merged
merged 3 commits into from
May 15, 2017

Conversation

eulphean
Copy link
Contributor

@eulphean eulphean commented May 11, 2017

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.

@msftclas
Copy link

@eulphean,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@@ -15,7 +15,9 @@ import { AccessibilityPlatformUtil } from '../common/AccessibilityUtil';

export class AccessibilityUtil extends AccessibilityPlatformUtil {
setAccessibilityFocus(component: React.Component<any, any>): void {
// NO-OP
if (RN.AccessibilityInfo && Accessibility.isScreenReaderEnabled()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you ensure RN.AccessibilityInfo.setAccessibilityFocus is defined, so this doens't crash on versions of RN without this API?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can merge these two checks

@@ -63,7 +63,9 @@ export class Accessibility extends NativeAccessibility {

// Some versions of RN don't support this interface.
if (RN.AccessibilityInfo) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge the two if blocks

@@ -15,7 +15,9 @@ import { AccessibilityPlatformUtil } from '../common/AccessibilityUtil';

export class AccessibilityUtil extends AccessibilityPlatformUtil {
setAccessibilityFocus(component: React.Component<any, any>): void {
// NO-OP
if (RN.AccessibilityInfo && Accessibility.isScreenReaderEnabled()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can merge these two checks

Amay Kataria added 3 commits May 15, 2017 11:22
…ocus programmatically on iOS. Also, expose .focus() API for RX.Button.
@berickson1 berickson1 merged commit 9a2df4f into microsoft:master 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.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants