mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 17:56:46 +00:00
Prevent automation action row issue if event name gets cleared (#8213)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
a8b27e224f
commit
cf43b26e14
@ -7,6 +7,7 @@ import {
|
|||||||
query,
|
query,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { html } from "lit-html";
|
import { html } from "lit-html";
|
||||||
|
import { fireEvent } from "../../../../../common/dom/fire_event";
|
||||||
import "../../../../../components/entity/ha-entity-picker";
|
import "../../../../../components/entity/ha-entity-picker";
|
||||||
import "../../../../../components/ha-service-picker";
|
import "../../../../../components/ha-service-picker";
|
||||||
import "../../../../../components/ha-yaml-editor";
|
import "../../../../../components/ha-yaml-editor";
|
||||||
@ -51,7 +52,7 @@ export class HaEventAction extends LitElement implements ActionElement {
|
|||||||
)}
|
)}
|
||||||
name="event"
|
name="event"
|
||||||
.value=${event}
|
.value=${event}
|
||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._eventChanged}
|
||||||
></paper-input>
|
></paper-input>
|
||||||
<ha-yaml-editor
|
<ha-yaml-editor
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
@ -73,8 +74,11 @@ export class HaEventAction extends LitElement implements ActionElement {
|
|||||||
handleChangeEvent(this, ev);
|
handleChangeEvent(this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _valueChanged(ev: CustomEvent): void {
|
private _eventChanged(ev: CustomEvent): void {
|
||||||
handleChangeEvent(this, ev);
|
ev.stopPropagation();
|
||||||
|
fireEvent(this, "value-changed", {
|
||||||
|
value: { ...this.action, event: ev.detail.value },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user