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 7693a9ac2a..d8009dd746 100644 --- a/src/panels/lovelace/editor/card-editor/hui-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-edit-card.ts @@ -194,7 +194,9 @@ export class HuiEditCard extends LitElement { this._loading = false; this._resizeDialog(); if (!this._uiEditor) { - this.yamlEditor.codemirror.refresh(); + setTimeout(() => { + this.yamlEditor.codemirror.refresh(); + }, 1); } }