Skip to content

[lexical-playground][lexical-link] Bug Fix: Prevent AutoLinkNode from creating extra paragraphs - #8127

Merged
etrepum merged 2 commits into
meta:mainfrom
polyrainbow:fix/5882/auto-link-node-does-not-create-new-paragraph
Feb 10, 2026
Merged

etrepum merged 2 commits into
meta:mainfrom
polyrainbow:fix/5882/auto-link-node-does-not-create-new-paragraph

Conversation

@polyrainbow

Copy link
Copy Markdown
Contributor

Description

Bug fix to prevent AutoLinkNode from creating an extra paragraph, when pressing Enter inside an AutoLinkNode.

Root Cause: AutoLinkNode.insertNewAfter() delegated to its parent (ParagraphNode) to create a new block, which caused a premature paragraph split during $splitNodeAtPoint. Then insertParagraph created another paragraph for the actual Enter key handling — resulting in 3 paragraphs instead of 2.

Closes #5882

Test plan

Before

before.mov

After

after.mov

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 10, 2026
@vercel

vercel Bot commented Feb 10, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Feb 10, 2026 4:35pm
lexical-playground Ready Ready Preview, Comment Feb 10, 2026 4:35pm

Request Review

@trinhvinhtruong96

Copy link
Copy Markdown
Contributor

This should also fix issue #8126. Thank you @polyrainbow

@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Feb 10, 2026
@etrepum
etrepum added this pull request to the merge queue Feb 10, 2026
Merged via the queue into meta:main with commit fb7b722 Feb 10, 2026
61 of 62 checks passed
@etrepum etrepum mentioned this pull request Feb 25, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — 628a61b6 Deployed Feb 10, 2026 by vercel[bot]
Preview – lexical — 628a61b6 Deployed Feb 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Additional paragraph inserted when pressing "Enter" within AutoLinkNode

3 participants