-
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 (from a physical keyboard) won't enter TextInput fields on Tab/Shift+Tab in Android #30464
Comments
This has been sitting for a few months now, is there anyone that can comment on what sort of timeline we could expect on this bug? |
https://developer.android.com/training/keyboard-input/navigation#Tab
https://reactnative.dev/docs/building-for-tv#code-changes
The reason here
which means you need to add the implementation explained here https://reactnative.dev/docs/building-for-tv#code-changes |
@NatPri were you able to get this working? |
I was moved to a different project before I could revisit this, so unfortunately I don't know where this ended up, sorry. |
@fabriziobertoglio1987 the workaround does not seem to work. Wrapping the TextInput in a Touchable and then tabbing never fires the onFocus of the touchable. Tried this a couple of times but it didn't work. onPress of the TouchableHighlight and TouchableNativeFeedback is fired but never onFocus. Also, I have a button below the text input, if the current keyboard focus is on the button - doing shift + tab does not take it back to the input (touchable wrapped input did not work here). Are you aware of any other workarounds? |
Can we add a dummy button and a textinput within the Touchable wrapper? May be focus is not happening as TextInput is the only control within wrapper and for that taking focus is explicitly disbaled here |
Summary: Right now, `requestFocus()` is a no-op if the EditText view thinks it's already focused. In certain cases, though, we still want to focus the view even if it's already focused - for example, if TalkBack is enabled and you dismiss the keyboard, you want to be able to tap on the TextInput again to bring back the keyboard, even though the View never thinks it lost focus. What I'm doing instead is basically disregarding the View's current focus state if we *would* focus the TextInput, which is in 3 circumstances: - When the view is attached to a window, if autofocus is true - When the focus is being requested by JS - When the focus is being requested by an accessibility action from the OS Changelog: [Android][Fixed] Change how TextInput responds to requestFocus to fix a11y focus issue Reviewed By: mdvacca Differential Revision: D19750312 fbshipit-source-id: 30b9fab40af4a083fa98f57aba7e586540238bea
I found a workaround for my project: Create a new Next, only render this solution on Android. Not the exact same interaction because the user needs one extra interaction to focus on the input, but at least they can get through our application now.
|
@RyanCommits Can you shift+tab from button to textinput as well? meaning backward navigation |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Hey everyone, this issue is still repro unfortunately. It seems like there is no other way, but wrapping TextInput and handling press events. Could you please give us some feedback (maybe it's not an issue at all) or estimations please? |
I am also having the same issue can't focus on text input |
Hi @RyanCommits, have you tested how this translates for users dependent on screen readers? |
@pandu-supriyono I'm no longer working on the application that had this issue, and haven't looked at it for a while. Best of luck, this is a tough one. |
I've tested the recommended workaround (wrap the text input in a When using TalkBack, navigating by swiping left and right, there is no real difference from navigating a native android text field. So all good there, it works as expected. However, for external keyboard users, who also use a screen reader there is a problem, in that focus moves to the To address this, we had to add an When you add the |
There are a tricky fix from the native side: https://github.com/ArturKalach/react-native-a11y/blob/master/docs/AndroidInput.md |
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
On Android devices, when other focusable controls (such as Buttons) are adjacent to a TextInput component, and a physical keyboard is used to interact with the app (e.g. via bluetooth or USB connection), keyboard focus will stop at the focusable element before the TextInput when tabbing or at the one after the TextInput when shift-tabbing.
React Native version:
Steps To Reproduce
Using the Snack below under Android (tested on Pixel 3 with Android 11)
Expected Results
The TextInput should participate in the keyboard tab order. Users may use a physical keyboard for accessibility reasons.
Snack, code example, screenshot, or link to a repository:
https://snack.expo.io/dg2qxBBue
The text was updated successfully, but these errors were encountered: