ravip
ravip

Reputation: 101

How to show Next button in Android keyboard in React Native

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

Answers (2)

Madhavi Jayasinghe
Madhavi Jayasinghe

Reputation: 596

Try the same without {}. returnKeyType = "next". This worked for me.

Upvotes: 4

Karthik Dechiraju
Karthik Dechiraju

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

Related Questions