It seems like prosemirror’s handling of the paste during an ime composition is messing with the composition. So for example:
- Select some text from somewhere and copy it to the clipboard. (e.g. “typing”)
- Open prosemirror.net (e.g. in Chrome on Windows)
- Focus the prosemirror editor on that page, select all the content (ctrl+a) and delete (just to make it easier to see)
- Change to the japanese ime and enable hiragana
aaa(which in hiragana would end up as
- Press ctrl + v to paste (you see
あああtypingso looks ok)
- Press enter
The result is the initial text of the composition is duplicated after the pasted text. e.g.
あああtypingあああ<caret>. If I try the same thing in a vanilla contentEditable div I get
あああ<caret>typing. For now I’ll probably handle this by adding a handler for paste to the handleDOMEvents and just return true if the view.composing is true but I figured I’d mention it here since it might be good to handle that in prosemirror.
BTW I did try calling blur and then focus on the view.dom to try and commit/end the current composition but the result was similarly weird. I see as soon as I paste so it still duplicated the text but did so replacing the last n characters of the text being replaced and it looks like only the first 2 characters are still in composition.