Set the second TextInput
focus, when the previous TextInput
‘s onSubmitEditing
is triggered.
Try this
-
Adding a Ref to second TextInput
ref={(input) => { this.secondTextInput = input; }}
-
Bind focus function to first TextInput‘s onSubmitEditing event.
onSubmitEditing={() => { this.secondTextInput.focus(); }}
-
Remember to set blurOnSubmit to false, to prevent keyboard flickering.
blurOnSubmit={false}
When all done, it should looks like this.
<TextInput
placeholder="FirstTextInput"
returnKeyType="next"
onSubmitEditing={() => { this.secondTextInput.focus(); }}
blurOnSubmit={false}
/>
<TextInput
ref={(input) => { this.secondTextInput = input; }}
placeholder="secondTextInput"
/>