react-native

TextInput cursor jump to right end when the input is empty


Cursor in the TextInput is jumping to the right end when the field is empty.

<TextInput 
    autoCorrect={ false }
    keyboardType="number-pad"
    autoCapitalize="none"
    placeholder="Inactivity time in seconds"
    onChangeText={ (value) => this.setState({ inactivityTime: value }) }
    value={ this.state.inactivityTime }
    style={ commons.pinInput } />

enter image description here

This issue only happens when the value prop of the TextInput is set to the state.


Solution

  • After wasting lot of time i found the solution add multiline={true}