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

TextInput broken for Korean in ReactNative 0.54 and 0.55 #19313

Closed
daesan opened this issue May 17, 2018 · 11 comments
Closed

TextInput broken for Korean in ReactNative 0.54 and 0.55 #19313

daesan opened this issue May 17, 2018 · 11 comments
Labels
Component: TextInput Related to the TextInput component. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@daesan
Copy link
Contributor

daesan commented May 17, 2018

Environment

Environment:
OS: macOS High Sierra 10.13.4
Node: 6.11.0
Yarn: Not Found
npm: 3.10.10
Watchman: Not Found
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: ^16.3.1 => 16.3.1
react-native: ^0.55.4 => 0.55.4

Steps to Reproduce

In TextInput, just type some Korean characters, such as "오후의 홍차". Then move the cursor to the space between "오후의" and "홍차", and then type some more Korean characters, such as "맛있는"

Expected Behavior

The text should be input like "오후의 맛있는 홍차"

Actual Behavior

However, as of RN version 0.54 and 0.55, the text is input like "오후의 ㅁㅏㅇㅣㅆㄴㅡㄴ 홍차"

Specifically, Korean characters are combined correctly when the cursor is at the end of text in TextInput, but if the cursor is placed at any position other than the end, Korean characters are not combined correctly.

@react-native-bot react-native-bot added the Component: TextInput Related to the TextInput component. label May 17, 2018
@daesan
Copy link
Contributor Author

daesan commented May 18, 2018

@shergin Do you mind looking at this issue? I've looked through the refactored codes for TextInput module in RN 0.54.0 and found that _onChange event in RCTBaseTextInputView.textInputDidChange breaks Korean IM input status.

This causes Korean characters to be typed like "ㅇㅏㄴㄴㅕㅇ" instead of "안녕". (Each part of character is input separately. They should be combined to form a complete character.)

@rodolphefauquez
Copy link

Maybe i'm wrong, but looks similar to this issue:
#18456
I have the same problem with japanese, i'm not able to write kanjis.

@daesan
Copy link
Contributor Author

daesan commented May 18, 2018

@rodolphefauquez It is a related issue. However, PR #18456 doesn't solve the Hangul input issue.

@daesan
Copy link
Contributor Author

daesan commented May 18, 2018

@shergin I did some more experimentation with this issue. It seems that the problem does not to lie with new TextInput implementation but rather with React Native's setState() call + view re-rendering cycle. (I guess the implementation behind this has changed in RN 0.54.0 as well.)

If I delete onChange/onChangeText callback from tag in jsx file, Hangul input issue disappears. But I do need onChange callback. If someone who is more familiar with RN 0.54 update details can suggest where this issue might be stemming from, it would be very much appreciated.

@benevbright
Copy link

This is the very critical issue for Korean user.

@JJMoon
Copy link

JJMoon commented Jun 4, 2018

This might cure it. It might happen when typing Japanese Hanja, Chinese. But, so far I have not confronted when I type Korean. Weird. I'm Korean, so I use it very much.

#18456 (comment)

@hyochan
Copy link
Contributor

hyochan commented Jul 10, 2018

The quick fix is not to setState in onChangeText and rather set this to private variable inside component which won't affect the render system. The default TextInput will show the output of the text when typing.

example

private searchTxt: string = '';
...
<TextInput
    onChangeText={(text) => this.searchTxt = text;}
    underlineColorAndroid='transparent' // android fix
    multiline={false}
    style={styles.inputSearch}
    onSubmitEditing={this.onSearch}
    defaultValue={this.searchTxt}
/>

Note: Above is just the workaround in ios. In android it won't work because text in TextInput is always changed when setState.

@ycai2
Copy link

ycai2 commented Jul 25, 2018

Think this might be caused by the same root problem discussed in #18874. Please check out their discussions.

@rarira
Copy link

rarira commented Sep 13, 2018

still happens in RN 0.57

@stale
Copy link

stale bot commented Jan 1, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 1, 2019
@stale
Copy link

stale bot commented Jan 20, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 20, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: TextInput Related to the TextInput component. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

9 participants