I use react native for Android, and I want to edit bunch of TextInput with the "next" option like here (ios version): https://github.com/facebook/react-native/pull/2149#issuecomment-129262565
I tried:
<TextInput
style = {styles.titleInput}
returnKeyType = {"next"}
autoFocus = {true}
placeholder = "Title"
onSubmitEditing={(event) => {
this.refs.SecondInput.focus();
}}
/>
<TextInput
ref='SecondInput'
style = {styles.descriptionInput}
multiline = {true}
maxLength = {200}
placeholder = "Description" />
But the keyboard is close and open and that's annoying.
from https://stackoverflow.com/a/4999372/1456487 i understand that in native android apps i would use:
android:imeOptions="actionNext"
Is there any way to do this?
Two methods exposed via the native element are .focus() and .blur() that will focus or blur the TextInput programmatically.
Use android:windowSoftInputMode="adjustResize". KeyboardAvoidingView and other keyboard-related components don't work quite well if you have "adjustPan" set for your android:windowSoftInputMode in AndroidManifest. xml . Instead, you should use "adjustResize" and have a wonderful life.
Show activity on this post. Then pass Keyboard. dismiss() to TextInput onFocus prop, to stop the keyboard from popping up when focused.
This ability introduced in react-native .22 .
https://github.com/facebook/react-native/commit/ab12189f87d8e7fd84a4f1b92fa97e8894e984c7
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