-
Notifications
You must be signed in to change notification settings - Fork 24.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
IOS talkback read order. #31410
Comments
So what you've found here is an interesting wrinkle in the way that native platforms handle focus order. Both iOS and Android follow similar rules here, so I suspect this issue impacts both iOS and Android equally, though they aren't 100% identical so it's possible that your example happens to work on Android. Generally speaking though, both platforms try to make focus match the visual order, from top-left to bottom-right, but both also take into account the view hierarchy itself to some degree when making this determination. Taking the visuals alone into account you'd expect that the order would be 1,2,3,4,5,6,7, but looking at the hierarchy makes it clear that 1,3,4,5,6,7,2 is the "correct" order. The reason for this is that the pink container element around elements 2 through 7, while not focusable itself comes directly after element #1 visually. It's top position is above element #2. So what the screen reader sees is element #1 first, then the pink container element. When it sees this, it doesn't just skip the container it because it's not focusable on its own, it starts walking down the tree from this element looking at its descendants. Since some of them are focusable, they are considered next in line, and focused next. Once it makes it through all of these descendants it continues walking the tree where it left off, and finally finds element #2. Neither iOS nor Android take the z-position into account during this calculation, but you could imagine that if the pink container had a higher z-index than the gray one, and was visually on top, that this order would make a bit more sense. There isn't really any workaround for this without the ability to manually define focus order, which RN doesn't currently support. The only "fix" would be to not trigger this in the first place by not making the container element higher than element #2. |
You can force focus order by specific native api. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Description
This bug is about accessibility. When the screen reader reads the contents from top to bottom, the order gets mixed because of the overlay sibling container. I've provided the code and a media about the issue.
wrongOrder.mov
React Native version:
Steps To Reproduce
Expected Results
expected.mov
Snack, code example, screenshot, or link to a repository:
The text was updated successfully, but these errors were encountered: