Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native android: How to select the next TextInput after pressing the “actionNext” keyboard button?

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

enter image description here

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?

like image 490
tal952 Avatar asked Jan 21 '16 14:01

tal952


People also ask

How do you focus on TextInput in react native?

Two methods exposed via the native element are .focus() and .blur() that will focus or blur the TextInput programmatically.

How do I stop keyboard pushing layout up in Android react native?

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.

How do I disable the keyboard in react native TextInput?

Show activity on this post. Then pass Keyboard. dismiss() to TextInput onFocus prop, to stop the keyboard from popping up when focused.


1 Answers

This ability introduced in react-native .22 .

https://github.com/facebook/react-native/commit/ab12189f87d8e7fd84a4f1b92fa97e8894e984c7

like image 123
tal952 Avatar answered Oct 11 '22 02:10

tal952