Added button with accessibility action example and support for Touchables#25582
Closed
KevinGVargas wants to merge 2 commits into
Closed
Added button with accessibility action example and support for Touchables#25582KevinGVargas wants to merge 2 commits into
KevinGVargas wants to merge 2 commits into
Conversation
…or accessibility actions for Touchables
analysis-bot
suggested changes
Jul 10, 2019
analysis-bot
left a comment
There was a problem hiding this comment.
Code analysis results:
eslintfound some issues. Runyarn lint --fixto automatically fix problems.
| </View> | ||
| </RNTesterBlock> | ||
|
|
||
| <RNTesterBlock title="Button with custom accessibility actions"> |
| </View> | ||
| </RNTesterBlock> | ||
|
|
||
| <RNTesterBlock title="Button with custom accessibility actions"> |
There was a problem hiding this comment.
no-trailing-spaces: Trailing spaces not allowed.
| } | ||
| }} | ||
| onPress={() => Alert.alert('Button has been pressed!')} | ||
| accessibilityRole="button"> |
| <View > | ||
| <Text>Click me</Text> | ||
| </View> | ||
| </TouchableWithoutFeedback> |
Contributor
|
Thanks! |
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
@osdnk has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
osdnk
approved these changes
Jul 10, 2019
Collaborator
|
This pull request was successfully merged by @AmazonKevin in b8ccb26. When will my fix make it into a release? | Upcoming Releases |
AKB48
pushed a commit
to UnPourTous/react-native
that referenced
this pull request
Apr 21, 2020
…ample and support for Touchables (facebook#25582)
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.
Summary
We added a test to make sure button and accessibility actions would not have unwanted behavior. Additionally we added support for accessibility actions for all touchables. However we discovered that RCTTextView and possibly anything else that does not derive from RCTView does not support accessibility actions and need to be children off a component that does support it for it to not crash in ios. This became noticeable when TouchableWithoutFeedback only worked if text is a child of view on ios.
In a local branch we where able to modify RCTTextView to support accessibility actions and text no longer needed to be a child of view for it to work.
Changelog
[General] [Added] - Button test with accessibility actions
[General] [Added] - Support for accessibility actions to all Touchables. With TouchableWithoutFeedback being a special case where text must be a child of view. (See AccessibilityExample.js for an example)
Test Plan
Test plan is testing in RNTester making sure the examples work
Open Question
What would you say is the best practice for adding accessibility action support for all the components that do not extended from RCTView?