-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Description
The documentation for setting accessibility focus is a bit unclear: https://reactnative.dev/docs/accessibilityinfo#setaccessibilityfocus
It states it should receive a reactTag: number, but there is no explanation of what this is and how one can find this. When googling, the usual approach seems to be using the findNodeHandle function, but this is deprecated with StrictMode with no apparent replacement.
What are we supposed to do here in that case? It still works, albeit with error spam, but given how important accessibility is this should probably be documented a bit clearer.
How can we address it?
Make it clear how this functionality is supposed to be used.
Why is it important?
Accessibility is important, and for us it is mandated by law that our app properly supports it. This might not be the case for everyone, but seems to be a growing "trend".
Since there is no easy way to control the screen reader flow as is, this tool can often come in handy to select the next focusable item that makes sense after an action. For example to focus the heading when opening a modal.
Who needs this?
Everyone working on a real project in production should (in theory) have use for this