Skip to content

Conversation

serranoio
Copy link

When Prosemirror is initialized inside a webcomponent, this.prosemirrorView._root is a ShadowRoot which does not have acreateRange method available on it, causing this error.

Screenshot 2025-09-14 at 15 37 10
  • This is backwards compatible:
    If createRange function is available, _root is Document, so no change
    if not, _root we assume it is ShadowRoot, and use the .ownerDocument function.

  • the code does not error on getSelection, but for consistency, I made the change here too 👍

Lmk if you have any questions :). I'd be happy to repro as well

@serranoio
Copy link
Author

Just saw #193. This is the same issue. However, this solution is backwards compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant