Skip to content

Feat/accessibility state alias - #34524

Closed
ankit-tailor wants to merge 26 commits into
react:mainfrom
ankit-tailor:feat/accessibility-state-alias
Closed

Feat/accessibility state alias#34524
ankit-tailor wants to merge 26 commits into
react:mainfrom
ankit-tailor:feat/accessibility-state-alias

Conversation

@ankit-tailor

@ankit-tailorankit-tailor commented Aug 29, 2022

Copy link
Copy Markdown
Contributor

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

<Viewaria-disabled={true}aria-selected={false}aria-checked={true}aria-expanded={true}aria-busy={true}style={{backgroundColor: '#527FE4',padding: 5}}><Textstyle={{fontSize: 11}}>Blue background</Text></View>

@facebook-github-botfacebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 29, 2022
@ankit-tailor

Copy link
Copy Markdown
ContributorAuthor

Hi @necolas, I will be adding other components to this PR.

@facebook-github-botfacebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 29, 2022
@react-native-botreact-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label Aug 29, 2022
Comment threadLibraries/Components/Pressable/Pressable.js
Comment threadLibraries/Text/Text.js
@necolas

Copy link
Copy Markdown

Please take a look at the failing tests. thanks

@ankit-tailor

Copy link
Copy Markdown
ContributorAuthor

Yes, looking into it.

@analysis-bot

analysis-bot commented Aug 30, 2022

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a7,639,245+1,010
androidhermesarmeabi-v7a7,051,502+999
androidhermesx867,940,841+1,009
androidhermesx86_647,912,841+1,002
androidjscarm64-v8a9,513,506+1,270
androidjscarmeabi-v7a8,289,111+1,255
androidjscx869,452,839+1,272
androidjscx86_6410,043,907+1,276

Base commit: 62f83a9
Branch: main

@analysis-bot

analysis-bot commented Aug 30, 2022

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
ios-universaln/a--

Base commit: 62f83a9
Branch: main

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Comment threadLibraries/Components/Pressable/Pressable.js Outdated
@ankit-tailor

Copy link
Copy Markdown
ContributorAuthor

Hi @necolas, I've added alias for core components. Just wanted clarification regarding failing test cases for undefined values.

@necolas

Copy link
Copy Markdown

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.

@ankit-tailor

Copy link
Copy Markdown
ContributorAuthor

@necolas updated all snapshots.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@ankit-tailor

Copy link
Copy Markdown
ContributorAuthor

@necolas@jacdebug Updated the latest changes, Let me know if anything else needs to be done.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @ankit-tailor in 98d84e5.

When will my fix make it into a release? | Upcoming Releases

@react-native-botreact-native-bot added the Merged This PR has been merged. label Sep 8, 2022
facebook-github-bot pushed a commit that referenced this pull request Oct 26, 2022
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
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.MergedThis PR has been merged.Needs TypeScript UpdateShared with MetaApplied via automation to indicate that an Issue or Pull Request has been shared with the team.Type: EnhancementA new feature or enhancement of an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ankit-tailor@necolas@analysis-bot@facebook-github-bot@react-native-bot@jacdebug