diff --git a/src/panels/lovelace/editor/hui-element-editor.ts b/src/panels/lovelace/editor/hui-element-editor.ts index d243f64911..9ac4546bab 100644 --- a/src/panels/lovelace/editor/hui-element-editor.ts +++ b/src/panels/lovelace/editor/hui-element-editor.ts @@ -82,6 +82,8 @@ export abstract class HuiElementEditor< @query("ha-yaml-editor") _yamlEditor?: HaYamlEditor; + private _loadCount = 0; + public get value(): T | undefined { return this._config; } @@ -411,7 +413,7 @@ export abstract class HuiElementEditor< if (!this.value) { return; } - + const loadNum = ++this._loadCount; try { this._errors = undefined; this._warnings = undefined; @@ -435,6 +437,9 @@ export abstract class HuiElementEditor< this.GUImode = false; } } catch (err: any) { + if (loadNum !== this._loadCount) { + return; + } if (err instanceof GUISupportError) { this._warnings = err.warnings ?? [err.message]; this._errors = err.errors || undefined;