Skip to content
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

[ASDisplayNode] Implement accessibilityElementsHidden #1859

Merged
merged 2 commits into from
Jun 3, 2020

Conversation

rcancro
Copy link
Contributor

@rcancro rcancro commented Jun 1, 2020

Most of this code comes from an old PR that @fruitcoder put up #795 2 years ago.

When creating our array of accessibilityElements, we need to respect the value of accessibilityElementsHidden. If the value of this property changes, we need to invalidate the cached accessibility elements (unless we are in the experiment that doesn’t cache accessibilityElements).

I created a simple test app and made sure this matched UIKit’s implementation. I also added a test case that changes the value of accessibilityElementsHidden and makes sure the proper accessibilityElements are returned.

Most of this code comes from an old PR that @fruitcoder put up TextureGroup#795 2 years ago.

When creating our array of accessibilityElements, we need to respect the value of `accessibilityElementsHidden`. If the value of this property changes, we need to invalidate the cached accessibility elements (unless we are in the experiment that doesn’t cache `accessibilityElements`).

I created a simple test app and made sure this matched UIKit’s implementation. I also added a test case that changes the value of `accessibilityElementsHidden` and makes sure the proper accessibilityElements are returned.
Copy link
Member

@nguyenhuy nguyenhuy left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@fruitcoder
Copy link
Contributor

@rcancro Wow, that looks great! Thanks for implementing this 👍

Talked with huy and decided to make a method to check if a  node is hidden, transparent or has `accessibilityElementsHidden` set to yes. Use this in 2 places when collecting accessibility elements to early exit or filter nodes.
@rcancro rcancro merged commit e16fdd6 into TextureGroup:master Jun 3, 2020
@rcancro rcancro deleted the hidden branch June 3, 2020 23:16
piotrdebosz pushed a commit to getstoryteller/Texture that referenced this pull request Mar 1, 2021
)

Most of this code comes from an old PR that @fruitcoder put up TextureGroup#795 2 years ago.

When creating our array of accessibilityElements, we need to respect the value of `accessibilityElementsHidden`. If the value of this property changes, we need to invalidate the cached accessibility elements (unless we are in the experiment that doesn’t cache `accessibilityElements`).

I created a simple test app and made sure this matched UIKit’s implementation. I also added a test case that changes the value of `accessibilityElementsHidden` and makes sure the proper accessibilityElements are returned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants