feat(editor): forward data attributes on bubble menu root components#3124
Merged
joaopcm merged 4 commits intofeat/ai-oss-editorfrom Mar 26, 2026
Merged
Conversation
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>
|
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
gabrielmfern
approved these changes
Mar 26, 2026
Co-authored-by: João Melo <joaopcm@users.noreply.github.com>
…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>
Member
Author
|
Auto-merge enabled (squash) via PR Sentinel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All four bubble menu
Rootcomponents and theirDefaultwrappers now accept and forward arbitrary HTML attributes (includingdata-*andaria-*) to the underlying TipTap<BubbleMenu>element.Previously, passing
data-editor-bubble-menu(or any other data attribute) toBubbleMenu.Rootfrom 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
Propsinterfaces withOmit<React.ComponentPropsWithoutRef<'div'>, 'children'>and added...restspread:packages/editor/src/ui/bubble-menu/root.tsx—BubbleMenuRootpackages/editor/src/ui/link-bubble-menu/root.tsx—LinkBubbleMenuRootpackages/editor/src/ui/button-bubble-menu/root.tsx—ButtonBubbleMenuRootpackages/editor/src/ui/image-bubble-menu/root.tsx—ImageBubbleMenuRootDefault wrappers — same treatment so that
BubbleMenu.Default(and siblings) also forwards data attributes through to the Root:packages/editor/src/ui/bubble-menu/default.tsx—BubbleMenuDefaultpackages/editor/src/ui/link-bubble-menu/default.tsx—LinkBubbleMenuDefaultpackages/editor/src/ui/button-bubble-menu/default.tsx—ButtonBubbleMenuDefaultpackages/editor/src/ui/image-bubble-menu/default.tsx—ImageBubbleMenuDefaultUsage
The internal
data-re-bubble-menuattribute is still set by default — this change is purely additive.Slack Thread
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
React.ComponentPropsWithoutRef<'div'>and spread...rest.data-re-bubble-menuby default; no breaking changes.Dependencies
@react-email/editorto0.0.0-experimental.36.Written for commit c2f6bf0. Summary will update on new commits.