fix(react, vue-2, vue-3): added shadow root remount logic to the framework integrations - #8146
Conversation
🦋 Changeset detectedLatest commit: 6526a70 The changes in this PR will be included in the next version bump. This PR includes changesets to release 74 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughSummaryFixed React, Vue 2, and Vue 3 when the same editor instance is remounted into a different Shadow DOM root. The integrations now call Also added/expanded tests for React/Vue 2/Vue 3 that mount one shared WalkthroughReact, Vue 2, and Vue 3 now refresh ProseMirror’s cached root when editor content moves between Shadow DOM trees. Tests verify remounting the same editor instance, and a changeset schedules patch releases. ChangesShadow DOM editor remount
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant EditorContent
participant EditorView
participant ShadowRoot
EditorContent->>ShadowRoot: Move editor view DOM nodes
EditorContent->>EditorView: Call updateRoot()
EditorView->>ShadowRoot: Resolve the current root node
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes
Fixes #8145
Changes and Review
EditorContent moves the live editor DOM between elements on mount, but ProseMirror kept its cached root node pointing at the previous document or shadow tree - so after remounting a persistent editor into a shadow root, all selection handling talked to the discarded root and the cursor stopped following clicks.
Without a framework integration, keeping the ProseMirror root in sync is the user's responsibility. With EditorContent, Tiptap owns the DOM lifecycle, so it should handle this automatically.
Checklist
Responsibility