Skip to content Skip to sidebar Skip to footer

ReturnKeyType = "next" Issue In React Native

I am using returnKeyType = 'next' in TextInput component, but it is working like returnKeyType='go' instead of moving to the next textinput field. How can we move from one textinpu

Solution 1:

You need to set focus on the next textfield using the reference like this:

<View style={{flex:1}}>
    <TextInput style={{height:40}} 
        placeholder="First TextField Input"
        placeholderTextColor="#DCDCDC"
        returnKeyType="next"
        onSubmitEditing={()=>this.secondTextInput.focus()}/>
    <TextInput style={{height:40}} 
        placeholder="Second TextField Input"
        placeholderTextColor="#DCDCDC"
        returnKeyType="go"
        ref={(input)=>this.secondTextInput = input}/> 
</View>

Post a Comment for "ReturnKeyType = "next" Issue In React Native"