-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/accessibility state alias #34524
Feat/accessibility state alias #34524
Conversation
Hi @necolas, I will be adding other components to this PR. |
Please take a look at the failing tests. thanks |
Yes, looking into it. |
Base commit: 62f83a9 |
Base commit: 62f83a9 |
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hi @necolas, I've added alias for core components. Just wanted clarification regarding failing test cases for undefined values. |
If in review a member of RN wants to do things differently for undefined values, they can bring that up. But you should update the snapshots so tests pass. |
@necolas updated all snapshots. |
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @ankit-tailor in 98d84e5. When will my fix make it into a release? | Upcoming Releases |
Summary: `aria-checked` prop should accept `mixed` as value as given [here](https://www.w3.org/WAI/GL/wiki/Using_WAI-ARIA_aria-checked%3Dmixed) and also [accessibilityState.checked](https://reactnative.dev/docs/accessibility#accessibilitystate) accepts mixed to represent checkboxes. This change refers to issue #34424 and PR #34524 ## Changelog [General] [Added] - Added `mixed` value for `aria-checked`. Pull Request resolved: #34633 Test Plan: ```js <TouchableOpacity accessibilityRole="checkbox" aria-checked="mixed" accessibilityHint="click me to change state"> <Text>Checkbox example</Text> </TouchableOpacity> ``` Reviewed By: lunaleaps Differential Revision: D39382158 Pulled By: necolas fbshipit-source-id: fa026274111305cc0bcbb42ed974ca1be7d779a5
Summary: This adds aliasing for accessibility state, it's used as requested on facebook#34424. - [aria-disabled](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled) to equivalent [accessibilityState.disabled](https://reactnative.dev/docs/accessibility#accessibilitystate) - [aria-busy](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-busy) to equivalent [accessibilityState.busy](https://reactnative.dev/docs/accessibility#accessibilitystate) - [aria-checked](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked) to equivalent [accessibilityState.checked](https://reactnative.dev/docs/accessibility#accessibilitystate) - [aria-expanded](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded) to equivalent [accessibilityState.expanded](https://reactnative.dev/docs/accessibility#accessibilitystate) - [aria-selected](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected) to equivalent [accessibilityState.selected](https://reactnative.dev/docs/accessibility#accessibilitystate) ## Changelog [General] [Added] - Add aria-disabled, aria-busy, aria-checked, aria-expanded and aria-selected prop to core components <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> Pull Request resolved: facebook#34524 Test Plan: ```js <View aria-disabled={true} aria-selected={false} aria-checked={true} aria-expanded={true} aria-busy={true} style={{backgroundColor: '#527FE4', padding: 5}}> <Text style={{fontSize: 11}}>Blue background</Text> </View> ``` Reviewed By: cipolleschi Differential Revision: D39137790 Pulled By: jacdebug fbshipit-source-id: 27b5c56e91731ba36bb4754d9862286a7a8191bc
Summary: `aria-checked` prop should accept `mixed` as value as given [here](https://www.w3.org/WAI/GL/wiki/Using_WAI-ARIA_aria-checked%3Dmixed) and also [accessibilityState.checked](https://reactnative.dev/docs/accessibility#accessibilitystate) accepts mixed to represent checkboxes. This change refers to issue facebook#34424 and PR facebook#34524 ## Changelog [General] [Added] - Added `mixed` value for `aria-checked`. Pull Request resolved: facebook#34633 Test Plan: ```js <TouchableOpacity accessibilityRole="checkbox" aria-checked="mixed" accessibilityHint="click me to change state"> <Text>Checkbox example</Text> </TouchableOpacity> ``` Reviewed By: lunaleaps Differential Revision: D39382158 Pulled By: necolas fbshipit-source-id: fa026274111305cc0bcbb42ed974ca1be7d779a5
Summary
This adds aliasing for accessibility state, it's used as requested on #34424.
Changelog
[General] [Added] - Add aria-disabled, aria-busy, aria-checked, aria-expanded and aria-selected prop to core components
Test Plan