简体   繁体   中英

React Native on android - focus from one TextInput to another TextInput needs 2 taps

it is really annoying, when I write text in one TextInput, then I tap on another TextInput to get focus with keyboard ready and it only hides the keyboard. How to overcome this behavior? All I want is to tap on TextInput and to have keyboard ready immediately.

Thanks for any advice!

Are your TextInputs in a ScrollView?

You need to add keyboardShouldPersistTaps={true} to you ScrollView .

keyboardShouldPersistTaps bool:

When false, tapping outside of the focused text input when the keyboard is up dismisses the keyboard. When true, the scroll view will not catch taps, and the keyboard will not dismiss automatically. The default value is false.

See Can't tap from one TextInput to another .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM