-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Keyboard Focus Stuck in Hidden View - Unable to Navigate Using Tab/Shift+Arrow Keys #35310
Comments
+1 to the issue. Bumping this up. |
Can't imagine you have found a solution to this, but could you share how you eventually may have tackled this issue? Despite contributor efforts I still experience lots of difficulty trying to find (re)sources on accessibility w.r.t. React Native that is both comprehensive and keeps in mind the requirements of people most dependent on accessibility features. |
Hello @RowlandOti , I also have a lib for supporting a11y: https://www.npmjs.com/package/react-native-a11y, there are solutions for keyboard too (force focus, focus change tracking, disable focus for element, etc). |
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
In an attempt to make app more accessible, we have added support for Talkback, screensreaders in react native screens of our hybrid app. These work fine, as accessibility roles, accessibility labels, and accessibility headers are defined in the accessible elements.
Some of our users also use keyboard navigation, and we have also tried adding that support. However, we are facing challenges in implementing that. One of the issues is that the keyboard focus seems to be getting stuck in views in the background instead of the currently visible view. This is most prevalent in nested React Native views i.e equivalent of the back stack in Android/iOS, where we show the back arrow on the top left of the screen. The View on top never gets to get keyboard focus, so users are left navigating through control elements that are off-screen. For back stack and navigation, we use react-native-navigation to layer our screens.
I have looked through the react native documentation and it seems to me that accessibility for RN ends with only Talkback and screenreaders. I have made the conclusion that accessibility focus seems to not be the same thing as keyboard focus, hence why the existing attributes for accessibility don't work. All the available props and attributes we could possibly use on views are only for screenreaders and talkback. It makes me wonder if I haven't looked hard enough. Does React Native support keyboard navigation? If yes, what attributes do I need to use to add the support?
In addition, I have looked through some of the issues filed around a similar theme, and they all seem open for a while now, with little to no engagement. Some of them are below:
Many more can be found from this search query: https://github.com/facebook/react-native/issues?q=physical+keyboard+focus+
I also saw a similar issue in react-navigation such as Navigating with a physical keyboard or TV remote gets focus out of the screen, which made me think the issue could also be caused by the navigation library in use.
Version
0.68.2
Output of
npx react-native info
Steps to reproduce
Setup a nested React Native screen setup like below:
One can access the screen
Routes.Registration
fromRoutes.Settings
. What we are facing is that when moving from one React Native screen to another, keyboard navigation seems to be stuck moving through elements in the previous screen, which is currently off-screen. The current screen on top does not get keyboard focus.Snack, code example, screenshot, or link to a repository
See the steps to repro
The text was updated successfully, but these errors were encountered: