-
Notifications
You must be signed in to change notification settings - Fork 1.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
Fix a11y update when insert view #1327
Fix a11y update when insert view #1327
Conversation
This reverts commit 06e18a1.
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.
Thanks Max – could you write down the motivation here?
Since not all nodes are backed by _ASDisplayViews (wrapper nodes) should we move this into something like _addSubnode:
or a place that is a tighter funnel?
As I tested the insertView will be called instead of addSubview below even for the view hierarchy is created first time. Another case is when view tree is updated by removing and inserting a new image node for example, the new image node will not have a11y info without this change. |
That makes sense but if we put the code in - (void)_addSubnode:(ASDisplayNode *)node {
// other code
if (node->_layer) {
// Find nearest view above (self or parent).
nearestView.accessibilityElements = nil;`
}
} |
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 pointed out to me that the other ASDisplayView subclass methods also follow this pattern, so I think this diff is quite safe.
No description provided.