Reputation: 101
I need to show Next button in Keyboard in React Native application when there are multiple TextInput fields are there. Could anyone suggest, I have tried with returnKeyType = {"next"} , blurOnSubmit and onSubmitEditing props but no use.
Could anyone you please provided the solution for this?
Thanks in Advance.
Upvotes: 3
Views: 4069
Reputation: 596
Try the same without {}. returnKeyType = "next"
. This worked for me.
Upvotes: 4
Reputation: 136
You can try onSubmitEditing
as described in the docs. This method will be called when you click done on the keyboard. In the listner, use focus
method to focus the required textInput.
render(){
return(
...
<TextInput
ref={(input) => this._username = input}
onSubmitEditing={() => this._email.focus()}
value={this.state.text}
blurOnSubmit={false} // prevent keyboard flickering
/>
<TextInput
ref={(input) => this._email = input}
onSubmitEditing={() => this._password.focus()} // or submit the form or focus next input and goes on
value={this.state.text}
blurOnSubmit={false}
/>
)
}
Upvotes: 3