SIGN IN SIGN UP
payloadcms / payload UNCLAIMED

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

0 0 281 TypeScript

fix(richtext-lexical): copying and pasting a single block in Lexical results in an error due to duplicate ID (#14738)

Fixes #14425, #14560 (duplicated)

Which are a specific instance of the issue #14130 that wasn’t resolved
in its PR (#14137)

### Description 

When the selection is on a decoratorNode, it's synthetic. In other
words, `windows.selection` doesn't actually contain anything from the
editor, and therefore the `COPY_COMMAND` event received with `cmd+c` is
a `KeyboardEvent`, not a `ClipboardEvent`.

I resolved this with a conditional block for the case where the
selection is of type `NodeSelection`.

### Tests

I added tests for the RangeSelection case as well as for NodeSelection
G
German Jablonski committed
cd9addf8fdb3661ff89367a4fc309533d62d7aea
Parent: ee632d4
Committed by GitHub <noreply@github.com> on 12/3/2025, 5:36:04 PM