When using insertText to insert Chinese characters in the handleTextInput option, handleTextInput will be triggered twice. #1375
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When I configure the handleTextInput option and use insertText to insert Chinese characters (English characters work fine), the characters are inserted twice. In fact, handleTextInput is being called twice. Testing has revealed that this issue occurs on Windows but works correctly on Mac. Could you please advise me on how to avoid this problem?
Here is a simple test case.
You can click here to view the demo.
Can't figure out what do you want to do.
Key reason is callback of function named
handleTextInputwill be invoked twice, here is one of function call in readDOMChange and another in keypress.You can dig the handleTextInput call stack, you will find the difference, input method behaviour handlers are different between Windows and MacOS. In Windows when the composition event emitted by keypress it will trigger keypress then caused readDOMChange callback, and some keypress will not trigger keypress events such as punctuation when using Chinese Pinyin IME.