Fix accessibilityOrder when referencing both a parent and its children #52115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
With the new implementation of accessibilityOrder we associate virtualView's nodes to the actual views they reperesent by calling
addChild(view)
This however causes an issue, the view itself will populate its accessibility children which prevents them from following the axOrder if both the parent and children are mentioned in the order.
With this change we now set a delegate and a provider to every view within the view that sets an axOrder to prevent the default logic to set accessibilityChildren on views that are not considered "containers".
In the case that they are "containers" (not accessible yet mentioned in the order) We want to keep the default logic that assigns them accessibilityChildren.
Differential Revision: D76911074