Skip to content

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

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

[lexical-playground][lexical-link] Bug Fix: Prevent AutoLinkNode from creating extra paragraphs#8127
etrepum merged 2 commits intofacebook:mainfrom
polyrainbow:fix/5882/auto-link-node-does-not-create-new-paragraph

Conversation

@polyrainbow
Copy link
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
Copy link

vercel bot commented Feb 10, 2026

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
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 facebook:main with commit fb7b722 Feb 10, 2026
63 of 64 checks passed
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