payload icon indicating copy to clipboard operation
payload copied to clipboard

LexicalEditor doesn't show the panel inside the blocks type

Open vuquangpham opened this issue 2 years ago • 7 comments

Link to reproduction

No response

Payload Version

v3.0.0-beta.57 (2024-07-02)

Node Version

22.3.0

Next.js Version

15.rc

Describe the Bug

Can not show the panel of the lexical editor inside the field of blocks type

// build config
export default buildConfig({
	admin: {
		user: Users.slug,
	},

	// Define and configure your collections in this array
	collections: [Media, Pages, Users],

	typescript: {
		outputFile: path.resolve(dirname, "payload-types.ts"),
	},

	// If you'd like to use Rich Text, pass your editor here
	editor: lexicalEditor(),

	// Your Payload secret - should be a complex and secure string, unguessable
	secret: ENV.PAYLOAD_SECRET,

	// Whichever database adapter you're using should go here
	// Mongoose is shown as an example, but you can also use Postgres
	db: mongooseAdapter({
		url: ENV.PAYLOAD_DATABASE_URI,
	}),

	// If you want to resize images, crop, set focal point, etc.
	// make sure to install it and pass it to the config.
	// This is optional - if you don't need to do these things,
	// you don't need it!
	sharp,

	plugins: [
		// storage-adapter-placeholder
	],
});
// collections
export const Pages: CollectionConfig = {
	slug: "pages",

	admin: {
		// useAsTitle: "title",
	},

	fields: [
		{
			name: "title",
			type: "richText",
			required: true,
		},
		{
			name: "components",
			blocks: [Accordion],
			type: "blocks",
			required: true,
		},
		{ ...created },
		{ ...modified },
	],
	versions: {
		drafts: true,
	},
};
// block
export const Accordion: Block = {
	slug: "accordion",
	fields: [
		{
			name: "heading",
			type: "text",
		},
		{
			name: "content",
			type: "richText",
			required: true,
			editor: lexicalEditor(),
		},
	],
};

Reproduction Steps

https://github.com/payloadcms/payload/assets/30406982/684da979-c6a8-4062-8b2e-08837df8ca2a

Adapters and Plugins

No response

vuquangpham avatar Jul 03 '24 15:07 vuquangpham

What do you mean with "panel"?

AlessioGr avatar Jul 03 '24 15:07 AlessioGr

@AlessioGr sorry for missing a descriptive, I mean this

Screenshot 2024-07-03 at 22 36 35

vuquangpham avatar Jul 03 '24 15:07 vuquangpham

Not able to show this panel inside the block of the block types

vuquangpham avatar Jul 03 '24 15:07 vuquangpham

I'm having a similar issue with Lexical

https://discord.com/channels/967097582721572934/1257686600788217856/1258073199611215982

ainsleyclark avatar Jul 03 '24 19:07 ainsleyclark

Reproduced this. This happens only if any field in the chain is named components.

AlessioGr avatar Jul 05 '24 22:07 AlessioGr

Fixed by https://github.com/payloadcms/payload/pull/7042

AlessioGr avatar Jul 05 '24 23:07 AlessioGr

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Sep 07 '24 01:09 github-actions[bot]