Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lexical editor config is discregarded when used within a Block #8303

Open
PavelGolodoniuc opened this issue Sep 19, 2024 · 0 comments
Open
Labels
status: needs-triage Possible bug which hasn't been reproduced yet v2

Comments

@PavelGolodoniuc
Copy link

Link to reproduction

No response

Describe the Bug

If you have a Block that is allowed within a Lexical editor that itself has a richText field with a Lexical editor, that block's lexical editor always uses default configuration regardless of what you provide it.

To Reproduce

export const Columns: Block = {
	slug: "columns",
	labels: {
		singular: "Columns",
		plural: "Columns",
	},
	fields: [
		{
			name: "style",
			type: "select",
			options: [
				{
					label: "Two-column split (6:6)",
					value: "dual-6-6",
				},
				{
					label: "Two-column split (5:1:6)",
					value: "dual-5-1-6",
				},
				{
					label: "Two-column split (4:1:7)",
					value: "dual-4-1-7",
				},
				{
					label: "Two-column split (7:1:4)",
					value: "dual-7-1-4",
				},
			],
		},
		{
			name: "colOne",
			label: "First column content",
			type: "richText",
			editor: lexicalEditor(defaultConfig),     // <-------------- PROBLEM IS HERE
		},
		{
			name: "colTwo",
			label: "Second column content",
			type: "richText",
			editor: lexicalEditor(defaultConfig),     // <-------------- PROBLEM IS HERE
			admin: {
				condition: (_data: any, siblingData: any) => !(<string>siblingData?.style).startsWith("single"),
			},
		},
	],
};

In the example above, both editors, defined as editor: lexicalEditor(defaultConfig) completely disregard defaultConfig.

Payload Version

2.28.0

Adapters and Plugins

"@payloadcms/richtext-lexical": "^0.11.3"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet v2
Projects
None yet
Development

No branches or pull requests

1 participant