[lexical] Bug Fix: copy NodeState when splitting text nodes#7641
Merged
etrepum merged 2 commits intofacebook:mainfrom Jun 24, 2025
Merged
[lexical] Bug Fix: copy NodeState when splitting text nodes#7641etrepum merged 2 commits intofacebook:mainfrom
etrepum merged 2 commits intofacebook:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
etrepum
reviewed
Jun 24, 2025
Collaborator
etrepum
left a comment
There was a problem hiding this comment.
Once the aliasing issue is addressed this looks like a good idea
etrepum
approved these changes
Jun 24, 2025
Collaborator
etrepum
left a comment
There was a problem hiding this comment.
Looks good! Will merge after the test run finishes
Merged
fantactuka
pushed a commit
that referenced
this pull request
Aug 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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