-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 not support Chinese input/clear() function doesn`t work in recent release of Reac-Native #18767
Comments
Thanks for posting this! It looks like your issue may be incomplete. Are all the fields required by the Issue Template filled out? If you believe your issue contains all the relevant information, let us know in order to have a maintainer remove the No Template label. Thank you for your contributions. |
This issue looks like a question that would be best asked on Stack Overflow. Stack Overflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. Will close this as this is really a question that should be asked on Stack Overflow. |
Problem has been solved here #18456, the code has not been merged to newest version, so you have to modify your code manually https://github.com/facebook/react-native/pull/18456/files |
i fixed the bug from @mkjfeng01. thanks. |
react-native version 0.55.3 has the same problem |
Same in react-native: 0.55.4. |
Any updates on this issue? |
@SunAnle @winglleung @johnxie Follow these file changes, and modify your code manual. I think this will solve your problem. https://github.com/facebook/react-native/pull/18456/files |
I find a workaround for this issue. the workaround is NOT use prop value and .clear(), instead use setNativeProps. following is my code sample. <TextInput
multiline={this.props.multiline}
onChangeText={(text) => this.onChangeText(text)}
//value={this.props.text}
blurOnSubmit={false}
//{...this.props.textInputProps}
ref={component => this._textInput = component}
onSubmitEditing={() => {
this.clearText()
}}
/> and clearText(){
if (Platform.OS === 'ios') {
this._textInput.setNativeProps({ text: ' ' });
}
setTimeout(() => {
this._textInput.setNativeProps({ text: '' });
},5);
} Hope it helps. |
@leonyhenn amazing, you save my life! What is the magic behind this? |
@leonyhenn you save my life 2 ! |
It seems like a very big problem, and not all TextInput component access to have this problem. I just found if I use defaultValue props, it will happen. This problem in react-native version 0.54.0~0.55.1, but normal in 0.53.0
The text was updated successfully, but these errors were encountered: