Skip to content

feat: added accessibility value aliases - #34535

Closed
dakshbhardwaj wants to merge 15 commits into
react:mainfrom
dakshbhardwaj:daksh/add-accessibility-value
Closed

feat: added accessibility value aliases #34535
dakshbhardwaj wants to merge 15 commits into
react:mainfrom
dakshbhardwaj:daksh/add-accessibility-value

Conversation

@dakshbhardwaj

Copy link
Copy Markdown
Contributor

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 to TouchableOpacity, View, PressableTouchableHighlightTouchableBounceTouchableWithoutFeedbackTouchableOpacity components

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

@facebook-github-botfacebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Aug 30, 2022
@react-native-botreact-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label Aug 30, 2022
@analysis-bot

analysis-bot commented Aug 30, 2022

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a7,640,076-1,366
androidhermesarmeabi-v7a7,052,425-1,309
androidhermesx867,941,824-1,341
androidhermesx86_647,913,752-1,473
androidjscarm64-v8a9,514,674-48
androidjscarmeabi-v7a8,290,285-46
androidjscx869,454,000-51
androidjscx86_6410,045,066-53

Base commit: 5e1c4d4
Branch: main

@analysis-bot

analysis-bot commented Aug 30, 2022

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

Base commit: 5e1c4d4
Branch: main

@jacdebug

jacdebug commented Aug 30, 2022

Copy link
Copy Markdown
Contributor

Thanks for working on this, could you please have a look on failing test @dakshbhardwaj

@dakshbhardwaj

Copy link
Copy Markdown
ContributorAuthor

Thanks for working on this, could you please have a look on failing test @dakshbhardwaj

@jacdebug I have updated my PR

@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.

@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.

@jacdebugjacdebug left a comment

Copy link
Copy Markdown
Contributor

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: props.accessibilityValue?.max,
: props.accessibilityValue?.text,

text:
this.props['aria-valuetext'] !== null
? this.props['aria-valuetext']
: this.props.accessibilityValue?.max,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: this.props.accessibilityValue?.max,
: this.props.accessibilityValue?.text,

text:
this.props['aria-valuetext'] !== null
? this.props['aria-valuetext']
: this.props.accessibilityValue?.max,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: this.props.accessibilityValue?.max,
: this.props.accessibilityValue?.text,

text:
this.props['aria-valuetext'] !== null
? this.props['aria-valuetext']
: this.props.accessibilityValue?.max,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: this.props.accessibilityValue?.max,
: this.props.accessibilityValue?.text,

text:
this.props['aria-valuetext'] !== null
? this.props['aria-valuetext']
: this.props.accessibilityValue?.max,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: this.props.accessibilityValue?.max,
: this.props.accessibilityValue?.text,

@dakshbhardwaj

Copy link
Copy Markdown
ContributorAuthor

Sorry for late review, please see inline comment for changes requested.

@jacdebug Thanks for the review, I have pushed down the review changes

@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.

@jacdebugjacdebug left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more left

Comment threadLibraries/Components/Pressable/Pressable.js Outdated
Co-authored-by: jacdebug <jacob.deepak@yahoo.com>
@dakshbhardwaj

Copy link
Copy Markdown
ContributorAuthor

One more left

@jacdebug pushed the changes

@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.

@jacdebug

Copy link
Copy Markdown
Contributor

there are some new conflicts @dakshbhardwaj

@dakshbhardwaj

Copy link
Copy Markdown
ContributorAuthor

there are some new conflicts @dakshbhardwaj

@jacdebug I have resolved the conflicts

@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.

@jacdebugjacdebug left a comment

Copy link
Copy Markdown
Contributor

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.

Comment on lines +248 to +251
max:
props['aria-valuemax'] !== null
? props['aria-valuemax']
: props.accessibilityValue?.max,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@dakshbhardwaj

Copy link
Copy Markdown
ContributorAuthor

Please see inline commend use nullish coalescing operator is correct and make code more readable.

@jacdebug I have made the changes

@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 @dakshbhardwaj in e8739e9.

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

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.

5 participants

@dakshbhardwaj@analysis-bot@jacdebug@facebook-github-bot@react-native-bot