react-native
react-native copied to clipboard
Rewrite accessibilityOrder with virtual view hierarchy
Summary:
The original algorithm for accessibilityOrder on Android had unexpected bugs. For some reason .traversalAfter() and traversalBefore() have unexpected behaviors when dealing with ancestor/descendant relationships getting more and more unexpected the further apart they are.
So we are ditching that approach entirely.
Now we have the view with accessibilityOrder create a virtual view hierarchy. We create a virtual node for each child that is in the order, and set the virtual node's position to be the same as the View it is trying to represent.
We then also populate that node with the same stuff we populate regular ax nodes with the populateAccessibilityNodeInfo() function and the content description of the view it is backing so we get matching descriptions with what would otherwise be the normal announcement.
We have no way to exhaustively check every accessibility use case so we'll have to fine tune this as bugs come up, I'm expecting there to not be many issues since we populate the node the exact same way we populate every other node but anything that happens before React Native handles the node might miss some things
Differential Revision: D74766296
This pull request was exported from Phabricator. Differential Revision: D74766296
This pull request was exported from Phabricator. Differential Revision: D74766296
This pull request has been merged in facebook/react-native@997b7c99f65a5022de34da875b390feedb282fa5.
This pull request was successfully merged by @jorge-cab in 997b7c99f65a5022de34da875b390feedb282fa5
When will my fix make it into a release? | How to file a pick request?