Skip to content

[lexical] Bug Fix: copy NodeState when splitting text nodes#7641

Merged
etrepum merged 2 commits intofacebook:mainfrom
randal-atticus:node-state-copy-sibling
Jun 24, 2025
Merged

[lexical] Bug Fix: copy NodeState when splitting text nodes#7641
etrepum merged 2 commits intofacebook:mainfrom
randal-atticus:node-state-copy-sibling

Conversation

@randal-atticus
Copy link
Copy Markdown
Contributor

@randal-atticus randal-atticus commented Jun 24, 2025

Description

Fixes node state not being copied to the new sibling nodes when splitting text nodes.

Test plan

Unit test created for this behaviour (and segmented text nodes)

Before

Formatting the middle of a TextNode with state applied to it would drop the styling (NodeState) from the split parts.

Screen.Recording.2025-06-24.at.11.28.34.am.mov

After

(Difficult to re-record the exact same situation above because it's on the NodeState docs page, but the test should demonstrate the desired outcome)
Here's a similar demo, showing it working:

Screen.Recording.2025-06-24.at.11.36.54.am.mov

@vercel
Copy link
Copy Markdown

vercel bot commented Jun 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 5:00am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 5:00am

@facebook-github-bot facebook-github-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 Jun 24, 2025
Copy link
Copy Markdown
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the aliasing issue is addressed this looks like a good idea

@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Jun 24, 2025
Copy link
Copy Markdown
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Will merge after the test run finishes

@etrepum etrepum added this pull request to the merge queue Jun 24, 2025
Merged via the queue into facebook:main with commit cdaf9c4 Jun 24, 2025
39 checks passed
@etrepum etrepum mentioned this pull request Jul 3, 2025
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.

3 participants