-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
dependency-issueThe issue is in a dependency of payload - not payload itselfThe issue is in a dependency of payload - not payload itselfplugin: richtext-lexical@payloadcms/richtext-lexical@payloadcms/richtext-lexical
Description
Describe the Bug
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.
Link to the code that reproduces this issue
https://github.com/BoavidaGuerra/payload/tree/reproduction/text-state-feature-bug
Reproduction Steps
- create a TextNode:
- apply a
background colour
andtext colour
to the TextNode.:
- select a portion of that TextNode and apply a different
text colour
The expectation is:
But outcome is:
Which area(s) are affected? (Select all that apply)
plugin: richtext-lexical
Environment Info
Binaries:
Node: 20.11.1
npm: 10.2.4
Yarn: N/A
pnpm: 9.7.1
Relevant Packages:
payload: 3.50.0
next: 15.4.4
@payloadcms/db-postgres: 3.50.0
@payloadcms/live-preview-react: 3.50.0
@payloadcms/translations: 3.50.0
react: 19.1.0
react-dom: 19.1.0
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:43 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8132
Available memory (MB): 32768
Available CPU cores: 10
Metadata
Metadata
Assignees
Labels
dependency-issueThe issue is in a dependency of payload - not payload itselfThe issue is in a dependency of payload - not payload itselfplugin: richtext-lexical@payloadcms/richtext-lexical@payloadcms/richtext-lexical