-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Description
Describe the Bug
Editing a copied inline block also modifies the original
// _community/collections/Post/index.ts
import type { CollectionConfig } from 'payload'
import { BlocksFeature, lexicalEditor } from '@payloadcms/richtext-lexical'
export const postsSlug = 'posts'
export const PostsCollection: CollectionConfig = {
slug: postsSlug,
admin: {
useAsTitle: 'title',
enableListViewSelectAPI: true,
},
fields: [
{
name: 'title',
type: 'text',
},
{
name: 'content',
type: 'richText',
editor: lexicalEditor({
features: ({ defaultFeatures }) => [
...defaultFeatures,
BlocksFeature({
inlineBlocks: [
{
slug: 'inline-media',
fields: [
{
name: 'title',
type: 'text',
},
],
},
],
}),
],
}),
},
],
}Link to the code that reproduces this issue
https://github.com/payloadcms/payload
Reproduction Steps
- Copy the above snippet to
_community/collections/Post/index.ts pnpm dev- Go to a post and create an inline block
- Copy and paste the block to duplicate it.
- Modify either of the two and observe the value of the other; it also changes.
Which area(s) are affected? (Select all that apply)
plugin: richtext-lexical
Environment Info
payload: 3.59.1
Metadata
Metadata
Assignees
Labels
No labels