From a3400a2f9c44c18327dff18884fefc24d78db05e Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Mon, 2 Oct 2023 11:44:43 +0200 Subject: [PATCH] Prevent ha-form data lost if quick data updates (#18094) --- src/components/ha-form/ha-form.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ha-form/ha-form.ts b/src/components/ha-form/ha-form.ts index b02f7f5b0d..68f34f7bd2 100644 --- a/src/components/ha-form/ha-form.ts +++ b/src/components/ha-form/ha-form.ts @@ -189,8 +189,13 @@ export class HaForm extends LitElement implements HaFormElement { ? ev.detail.value : { [schema.name]: ev.detail.value }; + this.data = { + ...this.data, + ...newValue, + }; + fireEvent(this, "value-changed", { - value: { ...this.data, ...newValue }, + value: this.data, }); }); }