4

I'm using react native TextInput field for save a password value, so I added the secureTextEntry to hide the value. So I type the password and everything is good but if I go to other field let say username and I go back to the password and I want to add a new character to the password that I put it before the input gets clear and take the new character as the new password. So for example if I type "cat" and then I want to add another letter for example "o" it does not add like this: "cato" instead just set the value to "o"

I'm using the onChangeText to handle the state but I dont know what is happening there..

This is the input:

<TextInput onChangeText = {(pass) => this.setState({pass})} value = {this.state.pass} secureTextEntry = {true} />
GeekDev
  • 385
  • 3
  • 16

1 Answers1

2

iOS by default clears the text in a secure text field. See further discussion of this issue on the underlying UITextField at UITextField with secure entry, always getting cleared before editing

Rob Walker
  • 877
  • 7
  • 13