TextInput onEndEditing doesn't work
See original GitHub issueI 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:
- Created 7 years ago
- Comments:11 (8 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It seems onEndEditing does not get the value of text, but just the event.
In the docs:
Whereas:
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.
In what way does
onEndEditing
differ fromonBlur
(was looking to implement on web)?