-
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
Add accessibilityHint for iOS #18093
Conversation
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.
Looks good, just one question inline.
React/Views/RCTView.m
Outdated
@@ -154,6 +154,15 @@ - (NSString *)accessibilityLabel | |||
return RCTRecursiveAccessibilityLabel(self); | |||
} | |||
|
|||
- (NSString *)accessibilityHint |
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.
Why is this needed? Can't we just use the prop directly?
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.
You're right, it is not needed. I tested after removing it, and it still works. I've updated this in the latest commit, 196ce06
Thanks for the PR! @facebook-github-bot shipit |
Something went wrong executing that command, @hramos could you take a look? |
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.
@janicduplessis is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
Hi @janicduplessis, seems like facebook-github-bot met some issues. Anything I can do? |
@draperunner Janic does not have visibility into the failure but I can help in this regard. It looks like this is held back due to a failing snapshot test. Getting this PR merged will require some manual intervention on my part. It's possible that the failing test is unrelated to this PR, so let me run the internal diff through the test suite one more time. Please do not add any more commits to this PR as doing so will prevent it from landing. Thanks! |
@hramos This adds a prop to View so it is very possible that some snapshots need to be updated. |
Indeed that's the case. The failing snapshot tests are all due to |
Snapshot tests updated and test suites are currently running. I'll check again in tomorrow morning and land this if all looks green. |
|
Any updates on this @hramos? |
@hramos @draperunner The PR doesn't touch any of the files from the log, maybe rebase on master and we can try shipping again. |
This adds the accessibilityHint for View, Text and Touchable* on iOS. The accessibilityHint provides some more information about an element when the accessibilityLabel is not enough.
It is enough to set the prop directly
efa01b2
to
b6b441f
Compare
@hramos @janicduplessis Hi guys. I have now rebased this PR and added Flow types. |
@hramos Wanna try landing this again? It will still require some snapshot updates. |
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.
@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Cc @TheSavior |
This will be landing soon. |
This pull request was closed by @draperunner in 253b29d. Once this commit is added to a release, you will see the corresponding version tag below the description at 253b29d. If the commit has a single |
Summary: This adds the accessibilityHint for View, Text and Touchable* on iOS. The accessibilityHint provides some more information about an element when the accessibilityLabel is not enough. The accessibilityHint is a core accessibility property on iOS. From https://developer.apple.com/documentation/objectivec/nsobject/1615093-accessibilityhint: > An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label. Related issue: facebook/react-native#14706 The npm scripts `test`, `flow`, `lint` and `prettier` are satisfied. I added a couple of examples to the RNTester app. The Accessibility Inspector on Mac helps debugging accessibility stuff on a simulator, but it does not show the accessibilityHint. Therefore I tested the RNTester app on an iPhone 8 device using VoiceOver to verify the hint functionality. It works fine, and I've tested disabling and enabling "read hints" in the VoiceOver settings on the phone. facebook/react-native-website#222 [IOS][FEATURE][Accessibility] - Add accessibilityHint for View, Text, Touchable* on iOS Closes facebook/react-native#18093 Reviewed By: hramos Differential Revision: D7230780 Pulled By: ziqichen6 fbshipit-source-id: 172ad28dc9ae2b67ea256100f6acb939f2466d0b
This adds the accessibilityHint for View, Text and Touchable* on iOS.
The accessibilityHint provides some more information about an element
when the accessibilityLabel is not enough.
Motivation
The accessibilityHint is a core accessibility property on iOS.
From https://developer.apple.com/documentation/objectivec/nsobject/1615093-accessibilityhint:
Related issue: #14706
Test Plan
The npm scripts
test
,flow
,lint
andprettier
are satisfied.I added a couple of examples to the RNTester app. The Accessibility Inspector on Mac helps debugging accessibility stuff on a simulator, but it does not show the accessibilityHint. Therefore I tested the RNTester app on an iPhone 8 device using VoiceOver to verify the hint functionality. It works fine, and I've tested disabling and enabling "read hints" in the VoiceOver settings on the phone.
Related PRs
facebook/react-native-website#222
Release Notes
[IOS][FEATURE][Accessibility] - Add accessibilityHint for View, Text, Touchable* on iOS