From 19887fbd542f8370c7c31c2dd7cd0aa74963a85a Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 13 Oct 2022 14:31:55 +0200 Subject: [PATCH] Remove undefined key in lovelace card config (#14081) --- src/panels/lovelace/editor/hui-element-editor.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/panels/lovelace/editor/hui-element-editor.ts b/src/panels/lovelace/editor/hui-element-editor.ts index 4f0483c659..0f08a36f94 100644 --- a/src/panels/lovelace/editor/hui-element-editor.ts +++ b/src/panels/lovelace/editor/hui-element-editor.ts @@ -271,6 +271,11 @@ export abstract class HuiElementEditor extends LitElement { private _handleUIConfigChanged(ev: UIConfigChangedEvent) { ev.stopPropagation(); const config = ev.detail.config; + Object.keys(config).forEach((key) => { + if (config[key] === undefined) { + delete config[key]; + } + }); this.value = config as unknown as T; }