Replies: 19 comments 5 replies
-
Actually I've just understood what iOS does thanks to this great article from Reveal App. In short, iOS looks at how the views are laid out on the screen and reads them left to right, top to bottom. There are two ways to change this behaviour:
I've created a custom view that allows control of both these attributes (the latter using React refs), but I feel like this might be something that makes sense to have in RN core. Wdyt? |
Beta Was this translation helpful? Give feedback.
-
Can you share your solution please ? |
Beta Was this translation helpful? Give feedback.
-
This is what I have https://gist.github.com/louy/6b66c45ae47bb4e3bac5a104dd0649ff I think it should be built into RN core tbh, but this works well for now |
Beta Was this translation helpful? Give feedback.
-
@louy Do you already have a PR on react-native core for this? |
Beta Was this translation helpful? Give feedback.
-
Nope just the snippet I shared above |
Beta Was this translation helpful? Give feedback.
-
I'd love to see support for Ideally I'd like to be able to make the screenreader understand that it should traverse the first fieldset before moving to the second, i.e. "Stats, question mark, Slot, Head..." etc. rather than "Stats, question mark, When equipped, question mark" |
Beta Was this translation helpful? Give feedback.
-
@AdamGerthel did you find a solution to your problem? Facing the same issue here |
Beta Was this translation helpful? Give feedback.
-
You can use this snippet as a temporary solution until it's built into RN https://gist.github.com/louy/6b66c45ae47bb4e3bac5a104dd0649ff When you wrap your views in a |
Beta Was this translation helpful? Give feedback.
-
thanks @louy , I'm fairly new to this but do I just copy the .tsx file into my project and use it like so? Or do I have to do something in the iOS folder as well? |
Beta Was this translation helpful? Give feedback.
-
Yes add the tsx files, but also make sure to drag the iOS files into Xcode (not just to the iOS folder, you have to drag them into the project tree in Xcode UI) |
Beta Was this translation helpful? Give feedback.
-
Thanks @louy ! Your solution solved my problem! |
Beta Was this translation helpful? Give feedback.
-
Thanks so much for creating this, @louy. Does anyone know if there is any movement on RN accessibility enhancements and focus order control? Given that so many of us are having to hack together multiple workarounds, a |
Beta Was this translation helpful? Give feedback.
-
@amarlette You might want to take a look at this! Focus order support would be a huge plus for RN. |
Beta Was this translation helpful? Give feedback.
-
I have an iOS VO bug (works in android TB) in my current app that is of critical importance to us to resolve because it affects the Section 508 status of the app. I tried The ios.incorrect.voiceover.read.order.movI just now confirmed that the bug exists in the ios.voiceover.vertical.ClinicListBottom.mp4 |
Beta Was this translation helpful? Give feedback.
-
We're running into this issue with an app using bottom tab navigation; when iterating over elements, instead of going all the way down the current page, the a11y item will move on to the first tab, then a button that is currently hidden from view, then continue with the tab bar; being able to group all elements on the current page and the tab bar would resolve this. The following demonstrates how iterating over accessible elements currently works: Unfortunately, the accessibility inspector doesn't seem to handle native tab navigation like the Photos app very well, so I'm not sure how it's supposed to work. |
Beta Was this translation helpful? Give feedback.
-
Maybe it is not you are looking for, but you can declare focus order for iOS and Android. |
Beta Was this translation helpful? Give feedback.
-
Thank you @louy for the code for RNAccessibilityWrapper, I was reading the article you posted here to see if I could figure out a way to do this without a native module, and I think it might be able accomplish accessibility "grouping" by using a https://snack.expo.dev/@cmoniz/accessibilitywrapper-without-the-native-module |
Beta Was this translation helpful? Give feedback.
-
I've encountered similar challenges with accessibility in React Native, exactly on iOS. Since it has specific APIs for accessibility focus order, maybe this way could help.. the approach consist to create a native module in React Native that bridges these iOS APIs to the Typescript side. This allows more control over the focus order. To my knowledge, there isn't a pre-existing package that addresses this, so it might be an opportunity to create a lib out of it 😁. It's crucial to align accessibility features in React Native with those available natively on iOS and Android for a consistent user experience. but the approach in gen eral should go something like this:
And then in the React Mative file:
hope it helps 👌🙏 |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
It has some nuances, but honestly, it works really well! API is really simple, we could control the order by web way via indexes. <A11y.Order>
<A11y.Index index={1}>
<Text style={styles.font}>
First
</Text>
</A11y.Index>
<A11y.Index index={3}>
<Text style={styles.font}>
Third
</Text>
</A11y.Index>
<A11y.Index index={2}>
<Text style={styles.font}>
Second
</Text>
</A11y.Index>
</A11y.Order> NO ScrollView groupingAdditionally, there's no need to group content using |
Beta Was this translation helpful? Give feedback.
-
Introduction
I know the accessibility focus order of components have been mentioned a few times but I couldn't really find anything helpful, so I thought I'd start a new discussion about it here.
facebook/react-native#13152
facebook/react-native#24239
The Core of It
On the web, screen readers determine the flow of which things are read by looking at the DOM tree and going from top the bottom, and this is the way accessibility is managed in React DOM.
However, on the native side (and more specifically on iOS) this doesn't seem to be the case.
I'm not really quite sure how iOS decides which views are read first, but I suspect it has to do with the timing and order in which these views were added to the screen.
iOS exposes some APIs to allow developers to control this order, but React Native doesn't seem to expose that to the Javascript side
Discussion points
Have anyone here had this issue before? What was your solution for it? Is this something that should live in a package (and are there any packages that already do that), or is it something that can/should be done in react-native?
Beta Was this translation helpful? Give feedback.
All reactions