Skip to content

fix(editor): support heading node placeholders - #3714

Open
Iiviavs wants to merge 1 commit into
resend:canaryfrom
Iiviavs:fix/editor-heading-placeholder
Open

fix(editor): support heading node placeholders#3714
Iiviavs wants to merge 1 commit into
resend:canaryfrom
Iiviavs:fix/editor-heading-placeholder

Conversation

@Iiviavs

@Iiviavs Iiviavs commented Aug 20, 2026

Copy link
Copy Markdown

Description

Fixes an issue where placeholder text for empty heading nodes (e.g., "Heading 1", "Heading 2") was not displayed in @react-email/editor.

Root Cause

  1. CSS Selector Scope: The placeholder pseudo-element rule in packages/editor/src/ui/themes/default.css was strictly targeting .tiptap p.is-empty::before.
  2. React Node View DOM Structure: The Heading extension uses ReactNodeViewRenderer, which renders content wrapped inside a NodeViewWrapper <div>. Tiptap attaches is-empty and data-placeholder attributes to this outer wrapper element rather than h1h6 tags directly.

Changes

  • Updated packages/editor/src/ui/themes/default.css to target h1h6.is-empty::before and div.is-empty[data-placeholder]::before.
  • Removed the outdated TODO in packages/editor/src/email-editor/email-editor.tsx.

Testing

  • Ran @react-email/editor unit tests (502 tests passing).
  • Verified placeholder styling in empty heading and paragraph nodes.

Summary by cubic

Fixes missing placeholder text for empty heading nodes in @react-email/editor. Previously placeholders appeared only for empty paragraphs; now headings show their placeholder by expanding the CSS selector to match where Tiptap applies is-empty and data-placeholder.

Review notes

  • Expand the .tiptap ...::before rule to h1h6 and .tiptap div.is-empty[data-placeholder] to cover React NodeView wrappers.
  • Remove an obsolete TODO; no runtime or API changes.
  • No migration required.

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

Review in cubic

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dbf4cd9

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

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

@Iiviavs is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant