How do I show Keyboard for TextInput programmatically using react native? Using a ScrollView, tapping between TextInput causes the keyboard to be dismissed. I want to show the Keyboard again using onFocus method of TextInput. Anyway to accomplish this?
Your ScrollView needs to include the keyboardShouldPersistTaps prop:
<ScrollView keyboardShouldPersistTaps></ScrollView>
consider have a reference of your textInput :
<TextInput ref={(ref)=>{this.myTextInput = ref}} />
And when you have to focus it again use : this.myTextInput.focus()
edit React16
For react16 use React.createRef
to create a reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With