-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextInput won't clear onKeyPress #9960
Labels
Resolution: Locked
This issue was locked by the bot.
Comments
Where you use this code? Android or IOS? onKeyPress work only on IOS) |
@antoxi4 I'm using on iOS |
I suggest using controlled components so that you can just clear out the data directly, rather than using refs and an uncontrolled form here. |
I also have the same problem |
you can like this this is my demo first set blurOnSubmit={true} second: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a multiline TextInput that I want to clear when the return key is pressed.
I have been able to clear the input with
this.refs.input.clear()
andthis.refs.input.setNativeProps({ text: '' })
but these don't work when using them onKeyPressThis does not work
I would expect that it would clear the input
Using RN 0.31.0
The text was updated successfully, but these errors were encountered: