-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
UIViewManager: Add accessibilityElementsHidden #10918
UIViewManager: Add accessibilityElementsHidden #10918
Conversation
By analyzing the blame information on this pull request, we identified @JoelMarcey and @javache to be potential reviewers. |
Can we avoid adding a new prop, and instead add iOS support for |
Sure, although if we are going to provide a unifrom API, I suggest it is better to add It is also going to be consistent across platforms as Thoughts? |
Ok, makes sense to me. We just need to make the documentation and examples very clear. We should highlight breaking changes for the community and put warnings for deprecated usage without breaking anything immediately. What steps do you think we should take to safely get to a sane state on these accessibility props? |
I think it is good to implement Next up, if someone complains with good reasons to keep |
Sounds great! Can you add android support for |
@ericvicenti Done. Please have a look and let me know if anything needs to be improved. |
* | ||
* @platform android | ||
* Controls whether the accessibility elements contained within this view are hidden. | ||
* Use this property to indicate whatever the should be reported to accessibility services that query the screen. |
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.
"whatever the should be reported"
typo?
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.
Yup, a typo. Just pushing a fix.
I don't know a lot about accessibility but I read over the conversation and this code and it seems perfectly reasonable. Would just fix up the comment describing the prop to fix typo. |
Typo fixed. :) |
@@ -97,6 +100,20 @@ public void setAccessibilityComponentType(T view, String accessibilityComponentT | |||
AccessibilityHelper.updateAccessibilityComponentType(view, accessibilityComponentType); | |||
} | |||
|
|||
@ReactProp(name = PROP_ACCESSIBILITY_ELEMENTS_HIDDEN) | |||
public void setImportantForAccessibility(T view, @Nullable Boolean accessibilityElementsHidden) { |
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 not name this method setAccessibilityElementsHidden
?
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.
No reason, I have no idea how I forgot to change that after copying the initial setImportantForAccessibility
method. Pushing a fix now.
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.
Fixed.
Thanks! I extended the comment a bit. @facebook-github-bot shipit |
@mkonicek has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@facebook-github-bot shipit |
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. |
Should I rebase this or something else has failed during import? @mkonicek |
UIKit accessibilityElementsHidden property is similar to Android's importantForAccessibility and very important for creating a good accessible experience by hidden off the screen and invisible elements/vies from VoiceOver and other assestive technologies. This commit also improves accessiblity of Navigation Experimental CardStack by marking inactive (off screen) scenes invsible for ios VoiceOver and Android's Talkback. Closes #9725
This commit adds Android support for View's `accessibilityElementsHidden` prop and marks Android only's `importantForAccessibility` as deprecated. This commit also includes the relevant improvements for NavigationExperimental NavigationCard.
@mkonicek Hey, so I keep rebasing this, any chance this could be shipped? this is really critcal for building accessible apps. |
UIKit
accessibilityElementsHidden
property is similar toAndroid's
importantForAccessibility
and very important forcreating a good accessible experience by hidding off the screen
and invisible elements/views from VoiceOver and other assistive
technologies.
This commit also improves accessibility of Navigation Experimental
CardStack by marking inactive (off screen) scenes invisible for iOS
VoiceOver and Android's Talkback.
Closes #9725