halilb / react-native-textinput-effects

Text inputs with custom label and icon animations for iOS and android. Built with react native and inspired by Codrops.
MIT License
2.98k stars 291 forks source link

Can not prevent special character #96

Closed ankhanguit closed 4 years ago

ankhanguit commented 5 years ago

I want to prevent user input the character "#", so I remove last character if it is "#". But, nothing happen, because you are holding input value on state.

halilb commented 5 years ago

Can you post an example for the problem @ankhanguit?

I tried this one and it worked for me on iOS:

// value is initially equal to ''
<Kaede
  label={'Email Address'}
  value={this.state.value}
  onChangeText={text => {
    this.setState({
      value: text.replace('#', ''),
    });
  }}
/>
halilb commented 4 years ago

Closing due to inactivity.