7

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?

Community
  • 1
  • 1
tal952
  • 845
  • 10
  • 18

1 Answers1

7

This ability introduced in react-native .22 .

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

tal952
  • 845
  • 10
  • 18
  • By using ref and this.[ref].focus() working fine but there is an effect of closing and reopening of keyboard which is not a good app behaviour. – Anand Kumar Jha Nov 08 '19 at 07:02