question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextInput onEndEditing doesn't work

See original GitHub issue

I wonder why onEndEditing on TextInput doesn’t work. Following code works well on onChangeText, but not on onEndEditing:

<TextInput ref="title"
   placeholder="Type title here"
   style={styles.title}
   onEndEditing={(text) => console.log(text)}
   onChangeText={(text) => console.log(text)}
/>

my env:

  • Ubuntu 14.04
  • Android 4.2.2
  • React Native 0.24

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
Tiagojdferreiracommented, May 13, 2016

It seems onEndEditing does not get the value of text, but just the event.

In the docs:

onChangeText function 

Callback that is called when the text input's text changes. **Changed text is passed as an argument to the callback handler.**

Whereas:

onEndEditing function 

Callback that is called when text input ends.

And if you log your text you get a SyntheticEvent.

What you were looking for was a onEndEditingText that unfortunately doesn’t seem to exist. It would be great to have that, as that was also the behaviour that I expected.

2reactions
necolascommented, Oct 28, 2016

In what way does onEndEditing differ from onBlur (was looking to implement on web)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Input onEndEditing weird callback - Stack Overflow
So I try to build a form validation with React Native and the onEndEditing. So my React Native code looks like this: <TextInput...
Read more >
TextInput - React Native
TextInput. A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, ...
Read more >
A complete guide to TextInput in React Native - LogRocket Blog
Learn how to implement React Native's TextInput component, customize it to collect user inputs, and style your fields with React Native ...
Read more >
TextInput – React Native | A framework for building ... - Deco IDE
Changed text is passed as an argument to the callback handler. onEndEditing function #. Callback that is called when text input ends. onFocus...
Read more >
TextInput · React Native Paper
A component to allow users to input text. ... If true, user won't be able to interact with the component. label. Type: TextInputLabelProp....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found