Skip to content

feat(editor): forward data attributes on bubble menu root components#3124

Merged
joaopcm merged 4 commits intofeat/ai-oss-editorfrom
cursor/bubble-root-data-attributes-bce1
Mar 26, 2026
Merged

feat(editor): forward data attributes on bubble menu root components#3124
joaopcm merged 4 commits intofeat/ai-oss-editorfrom
cursor/bubble-root-data-attributes-bce1

Conversation

@joaopcm
Copy link
Copy Markdown
Member

@joaopcm joaopcm commented Mar 26, 2026

Summary

All four bubble menu Root components and their Default wrappers now accept and forward arbitrary HTML attributes (including data-* and aria-*) to the underlying TipTap <BubbleMenu> element.

Previously, passing data-editor-bubble-menu (or any other data attribute) to BubbleMenu.Root from a consumer project had no effect — the props interface was closed and did not spread extra attributes onto the DOM element. Consumers had to rely on the internal [data-re-bubble-menu] selector which is an implementation detail.

Changes

Root components — extended Props interfaces with Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> and added ...rest spread:

  • packages/editor/src/ui/bubble-menu/root.tsxBubbleMenuRoot
  • packages/editor/src/ui/link-bubble-menu/root.tsxLinkBubbleMenuRoot
  • packages/editor/src/ui/button-bubble-menu/root.tsxButtonBubbleMenuRoot
  • packages/editor/src/ui/image-bubble-menu/root.tsxImageBubbleMenuRoot

Default wrappers — same treatment so that BubbleMenu.Default (and siblings) also forwards data attributes through to the Root:

  • packages/editor/src/ui/bubble-menu/default.tsxBubbleMenuDefault
  • packages/editor/src/ui/link-bubble-menu/default.tsxLinkBubbleMenuDefault
  • packages/editor/src/ui/button-bubble-menu/default.tsxButtonBubbleMenuDefault
  • packages/editor/src/ui/image-bubble-menu/default.tsxImageBubbleMenuDefault

Usage

<BubbleMenu.Root data-editor-bubble-menu="">
  {/* ... */}
</BubbleMenu.Root>

The internal data-re-bubble-menu attribute is still set by default — this change is purely additive.

Slack Thread

Open in Web Open in Cursor 

Summary by cubic

Bubble menu Root and Default components now accept and forward any HTML attributes to the underlying TipTap BubbleMenu. This enables custom data-* and aria-* selectors and better a11y without relying on the internal data-re-bubble-menu.

  • New Features

    • All Root and Default components extend React.ComponentPropsWithoutRef<'div'> and spread ...rest.
    • Keeps data-re-bubble-menu by default; no breaking changes.
  • Dependencies

    • Bump @react-email/editor to 0.0.0-experimental.36.

Written for commit c2f6bf0. Summary will update on new commits.

All four bubble menu Root components (BubbleMenuRoot, LinkBubbleMenuRoot,
ButtonBubbleMenuRoot, ImageBubbleMenuRoot) and their Default wrappers now
extend React.ComponentPropsWithoutRef<'div'> and spread ...rest onto the
underlying TipTap <BubbleMenu>. This allows consumers to pass arbitrary
data-* / aria-* / HTML attributes (e.g. data-editor-bubble-menu) without
relying on the internal [data-re-bubble-menu] attribute.

Co-authored-by: João Melo <joaopcm@users.noreply.github.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 26, 2026

⚠️ No Changeset found

Latest commit: c2f6bf0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-email Ready Ready Preview, Comment Mar 26, 2026 4:01pm
react-email-demo Ready Ready Preview, Comment Mar 26, 2026 4:01pm

Request Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@react-email/editor@3124

commit: b3451a5

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Co-authored-by: João Melo <joaopcm@users.noreply.github.com>
cursoragent and others added 2 commits March 26, 2026 15:59
…bubble-root-data-attributes-bce1

Co-authored-by: João Melo <joaopcm@users.noreply.github.com>
Co-authored-by: João Melo <joaopcm@users.noreply.github.com>
@joaopcm joaopcm requested a review from a-carciu March 26, 2026 16:00
@joaopcm
Copy link
Copy Markdown
Member Author

joaopcm commented Mar 26, 2026

Auto-merge enabled (squash) via PR Sentinel.

@joaopcm joaopcm merged commit 5f41b49 into feat/ai-oss-editor Mar 26, 2026
14 of 15 checks passed
@joaopcm joaopcm deleted the cursor/bubble-root-data-attributes-bce1 branch March 26, 2026 16:02
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.

3 participants