Enabling AccessibilityInfo.setAccessibilityFocus for MacOS#450
Merged
tom-un merged 11 commits intomicrosoft:masterfrom Jun 16, 2020
Merged
Enabling AccessibilityInfo.setAccessibilityFocus for MacOS#450tom-un merged 11 commits intomicrosoft:masterfrom
tom-un merged 11 commits intomicrosoft:masterfrom
Conversation
analysis-bot
suggested changes
Jun 12, 2020
analysis-bot
left a comment
There was a problem hiding this comment.
Code analysis results:
eslintfound some issues. Runyarn lint --fixto automatically fix problems.
tido64
reviewed
Jun 15, 2020
|
|
||
| RCT_EXPORT_METHOD(setAccessibilityFocus:(nonnull NSNumber *)reactTag) | ||
| { | ||
| dispatch_async(dispatch_get_main_queue(), ^{ |
Member
There was a problem hiding this comment.
Should we use RCTExecuteOnMainQueue here?
Suggested change
| dispatch_async(dispatch_get_main_queue(), ^{ | |
| RCTExecuteOnMainQueue(^{ |
(You might have to also add #import "RCTUtils.h" on top.)
Collaborator
There was a problem hiding this comment.
It is consistent with the iOS implementation that just calls dispatch_async on main queue. The RCTExecuteOnMainQueue does the same thing, but checks if already on the main queue and if so just calls the block. In this case it will always be called on the JS thread.
| } | ||
| } | ||
|
|
||
| class SetAccessibilityFocus extends React.Component<{}> { |
Member
There was a problem hiding this comment.
Did you create a PR upstream for this?
tom-un
approved these changes
Jun 16, 2020
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.
Please select one of the following
Summary
When the MacOS fork was made all the AccessibilityInfo functionality was stubbed out because the iOS Accessibility APIs are different from the MacOS APIs. I've filled back out the functionality for setAccessibilityFocus.
Changelog
[MacOS] [Added] - Implemented AccessibilityInfo.setAccessibilityFocus
Test Plan
Microsoft Reviewers: Open in CodeFlow