diff --git a/CHANGELOG.md b/CHANGELOG.md index bd0d6a13b8e..3d7d11a1f6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ - Fixed a bug where pressing Ctrl/Cmd + S in a slideout could also save the page behind it. ([#19705](https://github.com/craftcms/cms/pull/19705)) - Fixed a bug where Shift-selecting a shorter range didn’t deselect items outside the new range. ([#19727](https://github.com/craftcms/cms/pull/19727)) - Fixed a bug where select inputs could lose their selected value if their options were loaded asynchronously. ([#19728](https://github.com/craftcms/cms/pull/19728)) +- Fixed a bug where card designer previews could fail to render because the preview request omitted the element type. ([#19776](https://github.com/craftcms/cms/pull/19776)) - Fixed a bug where reactive controls in element editors didn’t refresh their field layouts, including nested form scopes. ([#19769](https://github.com/craftcms/cms/pull/19769)) ### Assets diff --git a/resources/js/modules/field-layout-designer/card-view-designer.ts b/resources/js/modules/field-layout-designer/card-view-designer.ts index d4b9ad2e08c..2f165a7dd8a 100644 --- a/resources/js/modules/field-layout-designer/card-view-designer.ts +++ b/resources/js/modules/field-layout-designer/card-view-designer.ts @@ -135,6 +135,10 @@ export class CardViewDesigner extends Base { data: { fieldLayoutConfig: { ...this.designer.config, + // Not part of `this.designer.config` (that lives at + // `designer.settings.elementType` instead), but `CardDesigner::previewHtml()` + // needs a `type` on the layout config to instantiate a sample element. + type: this.designer.settings!.elementType, generatedFields: document .querySelector('craft-generated-fields-table')