-
Notifications
You must be signed in to change notification settings - Fork 24.2k
-
Notifications
You must be signed in to change notification settings - Fork 24.2k
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 text is undefined on blur in android #20771
Comments
This issue was originally reported here but they didn't really provide examples/follow the template. |
I found a workaround here
|
Can you reproduce the issue on the latest release, v0.56? |
IMHO, it's better to use onChangeText and store the text in the state, then access text from state handleBlur = () => {
// access this.state.text
}
handleChangeText = text => {
this.setState({ text })
}
render() {
return (
<TextInput onChangeText={this.handleChangeText} value={this.state.text} />
)
} |
@dulmandakh Why did you close the issue though? The bug should still be fixed. Can we reopen? I have reproduced it in v0.57.1 (Expo v32). //cc @hramos |
Environment
Environment:
OS: macOS High Sierra 10.13.6
Node: 10.3.0
Yarn: 1.9.2
npm: 6.1.0
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: 3.1 AI-173.4720617
Packages: (wanted => installed)
react: ^16.4.1 => 16.4.1
react-native: 0.55.4 => 0.55.4
Description
I have an
onBlur
handler for a TextInput that should pass in the text via thenativeEvent
. However, the text is always undefined on android. It works on iOS.Reproducible Demo
https://snack.expo.io/By6uT3F87
The text was updated successfully, but these errors were encountered: