You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
{handleTextInput(view,from,to,text){const{ state }=viewconst{ tr }=statetr.insertText(text,from,to)view.dispatch(tr)returntrue}}
Can't figure out what do you want to do.
Key reason is callback of function named handleTextInput will 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.
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.
The text was updated successfully, but these errors were encountered: