Repository navigation
fix(editor): keep bubble menu styles in production builds - #3905
Conversation
Turbopack in Next.js 16.4 drops TipTap's prop sync on the bubble menu element in production. The menu then has no data-re-bubble-menu, so it loses its layout and theme. Render the attribute, className, style and other props on our own element inside TipTap's menu, so React sets them. On the homepage, scope the full-width rule to the .tiptap element. TipTap appends the menu as a direct child div, so the old rule made the menu full width on first show and put it at the editor's left edge. Fixes #3895.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 709944a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
The TipTap mock now forwards its props like the real component, so the test fails if Root sends className or the data attribute to TipTap again. The comment names only the attribute and style sync, and says when the workaround can go. The changeset says that position and z-index rules now apply to the inner element.
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 2 unresolved issues from previous reviews.
View guided diff | Re-trigger cubic
The menu's position rule now lives in bubble-menu.css, which owns its layout and which the default theme imports. Layout-only users get it too. Shorten the changeset entry.
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
View guided diff | Re-trigger cubic
The editor's bubble menu keeps its layout and theme again in Next.js 16.4 production builds with Turbopack. Before, the menu on the react.email homepage, and in any app on that setup, showed stacked controls with no background. The homepage menu also opened at the editor's left edge on the first selection. It now opens under the selected word.
Why not patch TipTap. #3896 patches
@tiptap/reactfor the website only. This fix also reaches apps that use the published editor, and nothing needs removal after vercel/next.js#100477 ships in a stable release.Gotcha. The visible menu box is now a child of TipTap's positioned element. Custom CSS that sets
z-indexthroughclassNamealso needsposition. The default theme sets both.How to reach it. Build
apps/webfor production withREDIS_URLset, then double-click a word in the homepage editor.Fixes #3895
Summary by cubic
Fixes the editor bubble menu losing its layout and theme in Next.js 16.4 production builds with Turbopack. The menu previously showed stacked controls with no background and opened at the editor's left edge on the first selection; it now opens under the selected word.
data-re-bubble-menu,className,style, and other props now go on a wrapper element inside TipTap's positioned menu element, so React sets them instead of relying on prop sync that Turbopack drops..tiptapso the menu no longer stretches to the editor edge.z-indexviaclassNamenow also needsposition, since those rules apply to the inner element, not the positioned one.positionis included in the layout styles.Fixes #3895.
Written for commit 709944a. Summary will update on new commits.