Fix a bug that input value disappears when using IME in Safari #184
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-safari-ime-mark"
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?
Thank you very much for making this excellent product publicly available.
While working with ProseMirror inside a shadow DOM, I encountered an issue in Safari when using an IME environment. This pull request provides a fix for that problem.
Steps to reproduce
Expected result
Actual result
https://github.com/user-attachments/assets/b77bfb72-5da5-4c49-b110-12caed8564e9
Conditions for occurrence
Patch contents
When using an IME in Safari within a shadow DOM, calling
selectCursorWrapper()prevents subsequent input from being reflected, so I avoided calling it.This change also affects cases where shadow DOM is not being used, but in Safari, even then, the expected result seems to be achieved without calling
selectCursorWrapper().Cursor wrappers are used to make sure composed text is, for example, actually bold (during composition) when you've enabled the bold mark and start composing before typing any other text. Blanket-disabling this on Safari doesn't seem like a good idea. Ideally, I'd want to fix the issue that's breaking cursor wrappers in shadow DOM, so that this feature works even there.
The root issue seems to be that
Selection.addRangedoesn't work in a shadow DOM on Safari. Attached patch works around that.Pull request closed