Keyboard doesn't show up when autoFocus on component mount
See original GitHub issueHello,
I am trying to use react-native-screens combine with react-navigation for my app for better performance, however I have a weird problem. Indeed, when I have a new page mounting with a TextInput
set on autoFocus
, it focused as expected but the keyboard does not show up on the screen.
If I don’t put useScreens()
it works perfectly, the TextInput is focused and the Keyboard appears.
react-native: 0.59.1; react-navigation: 3.8.1; react-native-screens: 1.0.0-alpha.22; OS: Android; Device: Real;
Issue Analytics
- State:
- Created 4 years ago
- Reactions:21
- Comments:43 (9 by maintainers)
Top Results From Across the Web
How to open keyboard automatically in React Native when ...
When you use autofocus, it basically calls focus once the component mounts so it's the same exact thing. If you type and it...
Read more >Keyboard doesn't show up when autoFocus on component mount
Hello,. I am trying to use react-native-screens combine with react-navigation for my app for better performance, however I have a weird problem.
Read more >TextInput - React Native
TextInput. A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, ...
Read more >Focus management with Vue refs - Learn web development
This can be disorienting for keyboard and non-visual users. ... To do that, we need to handle focus in the ToDoItem component's itemEdited() ......
Read more >3 ways to autofocus an input in React that ALMOST always work!
Thus, if we render the input element after the component mounts, we won't focus it. In this example, imagine loading is true for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same problem here.
I’m using a settimeout in componentdidmount to trigger the focus after some milliseconds, but still not the best because there is a necessary delay.
setTimeout(() => this.ref.focus(), 150)
Remove autoFocus prop on the component or else it won’t work.Looking forward to a better solution if possible.
Any updates for this problem? I have this problem in Android.
I have tried to use autoFocus and ref, but it didn’t help. What workarounds did you use?