diff --git a/src/panels/lovelace/components/hui-yaml-editor.ts b/src/panels/lovelace/components/hui-yaml-editor.ts index a885737f31..f83d392bee 100644 --- a/src/panels/lovelace/components/hui-yaml-editor.ts +++ b/src/panels/lovelace/components/hui-yaml-editor.ts @@ -73,7 +73,6 @@ export class HuiYamlEditor extends HTMLElement { }, }, }); - fireEvent(this, "yaml-changed", { value: this._value }); this.codemirror.on("changes", () => this._onChange()); } else { this.codemirror.refresh(); diff --git a/src/panels/lovelace/editor/card-editor/hui-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-edit-card.ts index d8009dd746..b11007465f 100644 --- a/src/panels/lovelace/editor/card-editor/hui-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-edit-card.ts @@ -357,6 +357,7 @@ export class HuiEditCard extends LitElement { configElement = await elClass.getConfigElement(); } else { this._configValue = { format: "yaml", value: yaml.safeDump(conf) }; + this._updatePreview(conf); this._uiEditor = false; this._configElement = null; return false; @@ -373,6 +374,7 @@ export class HuiEditCard extends LitElement { format: "yaml", value: yaml.safeDump(conf), }; + this._updatePreview(conf); this._uiEditor = false; this._configElement = null; return false;