Skip to content

Quill editor settings being overridden by defaults due _.merge #4795

@rohanrichards

Description

@rohanrichards

settings = _.merge(this.wysiwygDefault.quill, _.get(this.options, 'editors.quill.settings', {}), settings);

As seen at the above line, a call to merge is used to place user settings over the top of the defaults, but in the case of Quill these settings are nested arrays and merging the two results in duplications/replacements where they are not wanted.

Example, a custom wysiwyg component with quill as the editor :

{
	weight: 0,
	type: 'textarea',
	editor: 'quill',
	wysiwyg: {
		modules: {
			toolbar: [
				[{ 'size': ['small', false, 'large', 'huge'] }]
			]
		}
	},
	label: 'Content',
	hideLabel: true,
	input: true,
	key: 'html',
	as: 'html',
	rows: 3,
	tooltip: 'The HTML template for the result data items.'

The above will result in the custom dropdown "size" being visible, as well as all of the defaults rather than the expected setup of the single specified toolbar item being visible. As seen in the below screenshot:

Screenshot from 2022-07-28 16-10-32

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions