mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Clone on duplicate (#12574)
This commit is contained in:
parent
cfadf4d700
commit
6da4981b70
@ -1,3 +1,4 @@
|
||||
import deepClone from "deep-clone-simple";
|
||||
import "@material/mwc-button";
|
||||
import { css, CSSResultGroup, html, LitElement } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
@ -83,7 +84,7 @@ export default class HaAutomationAction extends LitElement {
|
||||
ev.stopPropagation();
|
||||
const index = (ev.target as any).index;
|
||||
fireEvent(this, "value-changed", {
|
||||
value: this.actions.concat(this.actions[index]),
|
||||
value: this.actions.concat(deepClone(this.actions[index])),
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import deepClone from "deep-clone-simple";
|
||||
import "@material/mwc-button";
|
||||
import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
@ -96,7 +97,7 @@ export default class HaAutomationCondition extends LitElement {
|
||||
ev.stopPropagation();
|
||||
const index = (ev.target as any).index;
|
||||
fireEvent(this, "value-changed", {
|
||||
value: this.conditions.concat(this.conditions[index]),
|
||||
value: this.conditions.concat(deepClone(this.conditions[index])),
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import deepClone from "deep-clone-simple";
|
||||
import "@material/mwc-button";
|
||||
import { css, CSSResultGroup, html, LitElement } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
@ -67,7 +68,7 @@ export default class HaAutomationTrigger extends LitElement {
|
||||
ev.stopPropagation();
|
||||
const index = (ev.target as any).index;
|
||||
fireEvent(this, "value-changed", {
|
||||
value: this.triggers.concat(this.triggers[index]),
|
||||
value: this.triggers.concat(deepClone(this.triggers[index])),
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user