Skip to content

Fix native input in empty React inline content - #3254

Open
nperez0111 wants to merge 1 commit into
mainfrom
fix/empty-react-inline-content
Open

nperez0111 wants to merge 1 commit into
mainfrom
fix/empty-react-inline-content

Conversation

@nperez0111

@nperez0111 nperez0111 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #2142. Follow-up to #3251.

#3251 fixed where TipTap mounts the editable content of React inline nodes, but an empty contentDOM can still have zero width inside the consumer's sized contentRef. Clicking that empty area and inserting text through native browser editing can put visible text beside contentDOM, leaving editor.document empty.

We also needed CSS to make editable inline content easier for consumers to handle without styling TipTap's internal content element themselves. Give the empty contentDOM its parent's minimum dimensions and an inline-block box. Apply this only while empty so populated text retains its normal wrapping and does not inherit a consumer's flex/grid layout. Keep the selector low-specificity so specialized layouts, including the inline math popup, retain their own rules.

This builds on @nperez0111's investigation and reproduction diff, which identified the CSS aspect of the issue and helped guide this fix.

Regression coverage

  • Plain and styled inline content with both inline-block and inline-flex contentRefs.
  • Click the empty area, insert native text, click unused space again, and insert another character.
  • Assert both visible text and editor.document, plus the populated contentDOM's normal display behavior. Keyboard-only insertion does not reproduce this failure because ProseMirror handles it directly.

Validation

  • 72 Docker browser tests pass across Chromium, Firefox, and WebKit, including adjacent React node-view and empty math input regressions.
  • Regression verified to fail without the CSS fix.
  • Manual Paseo browser check: click an empty tag and type, then confirm the text appears inside contentDOM and exported JSON. Also confirmed edits to a seeded replacement tag match the export; inspected a screenshot.
  • Targeted type-aware lint, formatting, and diff checks.

Summary by CodeRabbit

  • Bug Fixes
    • Empty inline content in React-rendered editor elements now retains enough space to be clicked and edited. Once content is added, it continues to display inline as expected.

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
blocknote Ready Ready Preview Oct 24, 2026 6:42am UTC
blocknote-website Ready Ready Preview Oct 24, 2026 6:42am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 32d9096d-0b27-4880-84a3-f32b4f2e5282
Commits

Reviewing files that changed from the base of the PR and between f90c34b and 0f7dad1.

Files selected for processing: 2
  • packages/react/src/editor/styles.css
  • packages/react/src/schema/ReactInlineContentSpec.browser.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

Empty React inline content receives CSS for an inline box and inherited minimum dimensions. A browser test checks native text input, computed display, and editor document content for plain and styled inline content.

Changes: React inline content editing

Layer / File(s) Summary
Empty-content layout and editing validation
packages/react/src/editor/styles.css, packages/react/src/schema/ReactInlineContentSpec.browser.test.tsx
Empty editable content uses an inline-block layout and inherits minimum height and width. The browser test checks native input and document content with inline-block and inline-flex layouts.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested reviewers: matthewlipski

Merge Risk: Minimal · up to 0f7da

The change is mergeable after normal checks; no actionable risk remains identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: fixing native input in empty React inline content.
Description check Passed The description provides detailed context, rationale, change scope, regression coverage, validation results, and impact information. It does not use every template heading and omits the checklist, but…
Linked Issues check Passed Issue #2142 is closed and supplies historical context only. No active directly linked issue remains, so this pull request has no linked-issue coding requirements.
Out of Scope Changes check Passed The changes stay within the stated fix. The CSS changes size empty React inline content and preserve populated display behavior. The browser tests cover the reported native-input regression and relate…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Description check

Explanation

The description provides detailed context, rationale, change scope, regression coverage, validation results, and impact information. It does not use every template heading and omits the checklist, but it is substantially complete and directly relevant.

Full details: Out of Scope Changes check

Explanation

The changes stay within the stated fix. The CSS changes size empty React inline content and preserve populated display behavior. The browser tests cover the reported native-input regression and related layout cases. No unrelated change is identified.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

A rabbit clicks the empty space,
Then types a letter in its place.
The content finds an inline line,
And shows its text in the design.
The document keeps each word in view,
The rabbit hops, delighted too.

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@3254

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@3254

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@3254

@blocknote/diagram-block

npm i https://pkg.pr.new/@blocknote/diagram-block@3254

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@3254

@blocknote/math-block

npm i https://pkg.pr.new/@blocknote/math-block@3254

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@3254

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@3254

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@3254

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@3254

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@3254

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@3254

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@3254

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@3254

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@3254

@blocknote/xl-typst-exporter

npm i https://pkg.pr.new/@blocknote/xl-typst-exporter@3254

commit: 0f7dad1

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-3254/

Built to branch gh-pages at 2026-10-24 06:49 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch was successfully deployed

2 active deployments
Preview – blocknote-website — 0f7dad13 Deployed Oct 24, 2026 by vercel[bot]
Preview – blocknote — 0f7dad13 Deployed Oct 24, 2026 by vercel[bot]
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.

Custom inline content not updating in the document

1 participant