Hi,
I am struggling to fix a problem with Japanese-Kana keyboard input on iOS devices (Safari, Chrome) that only appears when ProseMirror is created in shadow DOM. It seems to be related to prosemirror-view and the safariShadowSelectionRange function, and removing the code below seems to fix it, but I'm not sure (and don't have enough context) what else might be broken without that code 👇.
// Since such a range doesn't distinguish between anchor and head,
// use a heuristic that flips it around if its end matches the
// current anchor.
if (
isEquivalentPosition(
currentAnchor.node,
currentAnchor.offset,
focusNode,
focusOffset
)
)
[anchorNode, anchorOffset, focusNode, focusOffset] = [
focusNode,
focusOffset,
anchorNode,
anchorOffset,
];
Change your keyboard to Japanese and try to enter some characters in all 3 editors
Result
For ProseMirror in Shadow DOM, after typing any character, all characters are highlighted. User cannot enter more than one word as words are replaced
Expected result
Should behave exactly the same as in editor that was created in Light DOM
Hi, I am struggling to fix a problem with Japanese-Kana keyboard input on iOS devices (Safari, Chrome) that only appears when ProseMirror is created in shadow DOM. It seems to be related to
prosemirror-view
and thesafariShadowSelectionRange
function, and removing the code below seems to fix it, but I'm not sure (and don't have enough context) what else might be broken without that code 👇.Video https://github.com/ProseMirror/prosemirror/assets/8656036/2e4e12b9-1c45-4540-8b13-5699e2888546
Steps to reproduce
Result For ProseMirror in Shadow DOM, after typing any character, all characters are highlighted. User cannot enter more than one word as words are replaced
Expected result Should behave exactly the same as in editor that was created in Light DOM
Affected devices & browsers
Demo: Codepan - editor Codepan - preview