-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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: added accessibility value aliases #34535
feat: added accessibility value aliases #34535
Conversation
Base commit: 5e1c4d4 |
Base commit: 5e1c4d4 |
Thanks for working on this, could you please have a look on failing test @dakshbhardwaj |
@jacdebug I have updated my PR |
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for late review, please see inline comment for changes requested.
text: | ||
props['aria-valuetext'] !== null | ||
? props['aria-valuetext'] | ||
: props.accessibilityValue?.max, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: props.accessibilityValue?.max, | |
: props.accessibilityValue?.text, |
text: | ||
this.props['aria-valuetext'] !== null | ||
? this.props['aria-valuetext'] | ||
: this.props.accessibilityValue?.max, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: this.props.accessibilityValue?.max, | |
: this.props.accessibilityValue?.text, |
text: | ||
this.props['aria-valuetext'] !== null | ||
? this.props['aria-valuetext'] | ||
: this.props.accessibilityValue?.max, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: this.props.accessibilityValue?.max, | |
: this.props.accessibilityValue?.text, |
text: | ||
this.props['aria-valuetext'] !== null | ||
? this.props['aria-valuetext'] | ||
: this.props.accessibilityValue?.max, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: this.props.accessibilityValue?.max, | |
: this.props.accessibilityValue?.text, |
text: | ||
this.props['aria-valuetext'] !== null | ||
? this.props['aria-valuetext'] | ||
: this.props.accessibilityValue?.max, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: this.props.accessibilityValue?.max, | |
: this.props.accessibilityValue?.text, |
@jacdebug Thanks for the review, I have pushed down the review changes |
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more left
Co-authored-by: jacdebug <jacob.deepak@yahoo.com>
@jacdebug pushed the changes |
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
there are some new conflicts @dakshbhardwaj |
@jacdebug I have resolved the conflicts |
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see inline commend use nullish coalescing operator is correct and make code more readable.
max: | ||
props['aria-valuemax'] !== null | ||
? props['aria-valuemax'] | ||
: props.accessibilityValue?.max, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max: | |
props['aria-valuemax'] !== null | |
? props['aria-valuemax'] | |
: props.accessibilityValue?.max, | |
max: props['aria-valuemax'] ?? props.accessibilityValue?.max, |
This is more accurate and simple, please update the change for rest of properties on all changed files.
@jacdebug I have made the changes |
@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 @dakshbhardwaj in e8739e9. When will my fix make it into a release? | Upcoming Releases |
Summary: This adds aliasing for accessibility Value, it's used as requested on facebook#34424. - [aria-valuemax](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuemax) to equivalent [accessibilityValue.max](https://reactnative.dev/docs/accessibility#accessibilityvalue) - [aria-valuemin](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuemin) to equivalent [accessibilityValue.min](https://reactnative.dev/docs/accessibility#accessibilityvalue) - [aria-valuenow](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuenow) to equivalent [accessibilityValue.now](https://reactnative.dev/docs/accessibility#accessibilityvalue) - [aria-valuetext](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext) to equivalent [accessibilityValue.text](https://reactnative.dev/docs/accessibility#accessibilityvalue) ## Changelog [General] [Added] - Add `aria-valuemax`, `aria-valuemin`, `aria-valuenow`, `aria-valuetext` as alias prop to `TouchableOpacity`, `View`, `Pressable` `TouchableHighlight` `TouchableBounce` `TouchableWithoutFeedback` `TouchableOpacity` components Pull Request resolved: facebook#34535 Test Plan: - Enable `talkback`. - Open the RNTester app and navigate to the Api's tab - Go to the `fake Slider Example for Accessibility Value `modes section <Image src="https://user-images.githubusercontent.com/22423684/187472543-05200d8d-2742-4096-a56c-41f81b440a97.png" height="600" width="300" /> Reviewed By: cipolleschi Differential Revision: D39206362 Pulled By: jacdebug fbshipit-source-id: e7ed263badac789d529dd21e961cda5302b031e3
Summary
This adds aliasing for accessibility Value, it's used as requested on #34424.
Changelog
[General] [Added] - Add
aria-valuemax
,aria-valuemin
,aria-valuenow
,aria-valuetext
as alias prop toTouchableOpacity
,View
,Pressable
TouchableHighlight
TouchableBounce
TouchableWithoutFeedback
TouchableOpacity
componentsTest Plan
talkback
.fake Slider Example for Accessibility Value
modes section