Skip to content

Commit

Permalink
Prevent ha-form data lost if quick data updates (#18094)
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya authored Oct 2, 2023
1 parent c345f41 commit a3400a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/ha-form/ha-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
}
Expand Down

0 comments on commit a3400a2

Please sign in to comment.