fix: tinymce does not use its default config

Specifically for height, width, content_css, and style_formats, tinymce did not use its fallbacks if they were not provided through the data type.
This commit is contained in:
Jacob Overgaard
2024-05-10 15:41:43 +02:00
parent 23968b738e
commit d90763a9b4
2 changed files with 5 additions and 5 deletions

View File

@@ -196,10 +196,10 @@ export class UmbInputTinyMceElement extends UUIFormControlMixin(UmbLitElement, '
// create an object by merging the configuration onto the fallback config
const configurationOptions: RawEditorOptions = {
...defaultFallbackConfig,
height: dimensions?.height || undefined,
width: dimensions?.width || undefined,
content_css: stylesheets,
style_formats: styleFormats,
height: dimensions?.height ?? defaultFallbackConfig.height,
width: dimensions?.width ?? defaultFallbackConfig.width,
content_css: stylesheets.length ? stylesheets : defaultFallbackConfig.content_css,
style_formats: styleFormats.length ? styleFormats : defaultFallbackConfig.style_formats,
};
// no auto resize when a fixed height is set