ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.53k stars 334 forks source link

The order in which the handleTextInput and compositionend events are executed is affected by the input event #1459

Closed hhc-start closed 2 months ago

hhc-start commented 2 months ago

Same plugin structure, one listens for input events in handleDOMEvents (does nothing) and the other doesn't. WVV}@{(N6CCNXLY($ 1FIE0 Then make the IME input. The order in which input event is not listened (textinput-compositionend-textinput)

image

The order in which the input event is listened (textinput-textinput-compositionend):

image

This situation causes me to have a problem with the judgment of the end of the IME input, although there are solutions that can be solved in both cases, but there are still some doubts about the input listening affecting the order of events, I hope to answer it. Which should be the normal process.

marijnh commented 2 months ago

That seems to be a browser issue. ProseMirror cannot control the order in which DOM events come in.

hhc-start commented 2 months ago

Okay, it seems that I have to be compatible with both situations.