diff --git a/src/panels/lovelace/cards/hui-card.ts b/src/panels/lovelace/cards/hui-card.ts index 34c47a691e93..5e2d832a4a95 100644 --- a/src/panels/lovelace/cards/hui-card.ts +++ b/src/panels/lovelace/cards/hui-card.ts @@ -150,8 +150,10 @@ export class HuiCard extends ReactiveElement { if (changedProps.has("config")) { const elementConfig = this._elementConfig; if (this.config !== elementConfig && this.config) { - const typeChanged = this.config?.type !== elementConfig?.type; - if (typeChanged) { + const typeChanged = + this.config?.type !== elementConfig?.type || this.preview; + // Rebuild the card if the type of the card has changed or if we are in preview mode + if (typeChanged || this.preview) { this._loadElement(this.config); } else { this._updateElement(this.config);