You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TextStateFeature: Partial selection erases key-values from subsequent TextNodes #13386
When applying a new (e.g.) text colour to a partial selection inside a TextNode, TextStateFeature splits the original TextNode into multiple segments (before selection, selection, after selection). However, during this split and patch process, it incorrectly discards the existing key-values (like background colour and text colour) from all resulting TextNodes after the selection.
Expected:
The key-values (background and text colours) remain intact on all unselected portions.
Only the selected portion receives the new text colour override.
Actual:
All text following the selection loses the previously applied key-values.
Activity
GermanJablo commentedon Aug 7, 2025
Thanks. I remember running into that problem. I think it's a bug in Lexical, specifically in the
forEachSelectedTextNodefunction.BoavidaGuerra commentedon Aug 26, 2025
Hi @GermanJablo ,
Looks like the bug was fixed in Lexical by the following commit: meta/lexical#7641 , which was released in v0.33.0.
By fixing the
TextNode.splitTextmethod (which previously did not copy theNodeState), the behaviour inforEachSelectedTextNodewas also corrected.If I'm not mistaken, Payload is currently using
v0.28.0of Lexical. Do you guys have any plans to upgrade it?feat(richtext-lexical): upgrade lexical from 0.28.0 to 0.34.0 (#13622)
github-actions commentedon Sep 9, 2025
🚀 This is included in version v3.55.0
github-actions commentedon Sep 17, 2025
This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.