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
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 "๋ง์๋"
The text should be input like "์คํ์ ๋ง์๋ ํ์ฐจ"
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.
@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.)
Maybe i'm wrong, but looks similar to this issue:
I have the same problem with japanese, i'm not able to write kanjis.
@rodolphefauquez It is a related issue. However, PR #18456 doesn't solve the Hangul input issue.
@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
This is the very critical issue for Korean user.
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.
https://github.com/facebook/react-native/pull/18456#issuecomment-388171810
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.
Think this might be caused by the same root problem discussed in #18874. Please check out their discussions.
still happens in RN 0.57
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.
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.
Most helpful comment
This is the very critical issue for Korean user.