Skip to content

[lexical] Bug Fix: format removed on multi selection after replace#8069

Merged
etrepum merged 1 commit intofacebook:mainfrom
kimseongyu:format-removed-on-multi-selection-after-replace
Jan 11, 2026
Merged

[lexical] Bug Fix: format removed on multi selection after replace#8069
etrepum merged 1 commit intofacebook:mainfrom
kimseongyu:format-removed-on-multi-selection-after-replace

Conversation

@kimseongyu
Copy link
Copy Markdown
Contributor

Description

Current behavior:
When a user applies formatting to first node and selects it with other nodes to replace the text, only the first inserted character retains the formatting. because insertText uses spliceText to insert the first character, it causes the selection's format state to reset. As a result, characters typed after the first one don't inherit the original formatting.

Changes in this PR:
Preserve formatting when text is spliced across multiple nodes. the selection's format don't reset after splicing, so user inputs retain the original formatting.

Closes #8067

Test plan

Before

before.mov

After

after.mov

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 10, 2026

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

Project Deployment Review Updated (UTC)
lexical Ready Ready Preview, Comment Jan 10, 2026 2:15am
lexical-playground Ready Ready Preview, Comment Jan 10, 2026 2:15am

@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 Jan 10, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Jan 11, 2026
@etrepum etrepum added this pull request to the merge queue Jan 11, 2026
Merged via the queue into facebook:main with commit e828a3d Jan 11, 2026
43 checks passed
@etrepum etrepum mentioned this pull request Jan 31, 2026
@kimseongyu kimseongyu deleted the format-removed-on-multi-selection-after-replace branch February 16, 2026 10:59
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: Formatting removed on applying any of bold , italics and underline then replacing.

2 participants