Prevent ha-form data lost if quick data updates (#18094)

This commit is contained in:
Paul Bottein 2023-10-02 11:44:43 +02:00 committed by GitHub
parent c345f41416
commit a3400a2f9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
});
});
}