I have just placed TextInput KeyboardType ={"numeric"}
just trying to find weather user enter '-' if means I have to event.preventDefault()
in OnChange first.Later tried in onKeyPress but onKeyPress is not trigerring , I was just tried to do that but it allowing me to type shows warning Synthetic Event Performance issue.
guys help me .
You are testing with android mobile whereasonKeyPress
method is for iOS
, check documentation for same
You can use onChangeText
for text change.
Example:
<TextInput
onChangeText={(text) => this.onFirstNameText(text)}
returnKeyType={'next'}
underlineColorAndroid='transparent'
style={styles.inputColLeft}
/>
Edit 2018
onKeyPress
is now also supported for Android devices as per this commit.
From doc:
Note: on Android only the inputs from soft keyboard are handled, not the hardware keyboard inputs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With