focus a TextInput from another TextInput makes the keyboard jump
See original GitHub issueDescription
I have a simple View
with two TextInput
s in it. They both have a ref
. The first TextInput
has 'email'
as ref
and the second one has 'password'
. The email field has returnKeyType='next'
and onSubmitEditing={() => this.refs.password.focus() }
. This works fine. I tap in the email, then tap the next button on the keyboard and the password field becomes active for editing.
The problem is that the keyboard jumps. While the transition of focus is happening, the keyboard starts hiding and showing again. This looks weird, and also causes some relayout to jump around.
What I expect to happen is that the keyboard stays put while the focus changes. Either by me specifying it, or (better) by detecting that we need the keyboard on the next view, so keep the keyboard shown.
Reproduction
https://rnplay.org/apps/3wvzeg In rnplay it doesnt jump because its slow, but try it on an ios device. Make a new react native app and paste the code, to see.
Solution
I guess check the next focus, and if its a TextInput
, dont dismiss the keyboard? I dont know exactly.
Additional Information
- React Native version: 0.38.0
- Platform: iOS
- Operating System: MacOS
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Have you tried
blurOnSubmit={false}
?Guys, Any Solution found ??