Skip to content
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

onChangeText is too late? #13674

Closed
mehulmpt opened this issue Apr 26, 2017 · 1 comment
Closed

onChangeText is too late? #13674

mehulmpt opened this issue Apr 26, 2017 · 1 comment
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@mehulmpt
Copy link

Hello,
I'm using <TextInput> component in my app with onChangeText event and I'm setting value attribute to this.state.inputText which I update myself in callback.

However, sometimes I try not to update the text, i.e. I'll not update the state and hence the text SHOULD NOT appear in the TextInput. But I see the text updated inside input field for a fraction of second and then it goes back to original.

Ex -

ABC______________ <-- textinput
My onChangeText={this.doSomething} function:

doSomething(text) {
if(text == 'ABCD') return;
this.setState({inputText: text});
}

Now when I enter D above, 'D' will appear in the input field for a fraction of second whereas ideally it should not. Why is onChangeText firing after the text has already been displayed inside TextInput?

--- Delete everything above this line ---

Additional Information

  • React Native version: 0.43
  • Platform: Android
  • Development Operating System: Windows
  • Dev tools: Not really
@hramos
Copy link
Contributor

hramos commented May 31, 2017

Hey, thanks for reporting this issue!

It looks like your description is missing some necessary information. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.

I am going to close this, but feel free to open a new issue with the additional information provided. Thanks!

@hramos hramos closed this as completed May 31, 2017
@facebook facebook locked as resolved and limited conversation to collaborators May 31, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants