Don't use selector inside choose action (#13705)

This commit is contained in:
Paul Bottein 2022-09-13 10:43:38 +02:00 committed by Bram Kragten
parent d78191efa6
commit 8f6a09f44c
No known key found for this signature in database
GPG Key ID: FBE2DFDB363EF55B

View File

@ -9,7 +9,6 @@ import { Action, ChooseAction } from "../../../../../data/script";
import { haStyle } from "../../../../../resources/styles"; import { haStyle } from "../../../../../resources/styles";
import { HomeAssistant } from "../../../../../types"; import { HomeAssistant } from "../../../../../types";
import { ActionElement } from "../ha-automation-action-row"; import { ActionElement } from "../ha-automation-action-row";
import "../../../../../components/ha-form/ha-form";
@customElement("ha-automation-action-choose") @customElement("ha-automation-action-choose")
export class HaChooseAction extends LitElement implements ActionElement { export class HaChooseAction extends LitElement implements ActionElement {
@ -64,13 +63,13 @@ export class HaChooseAction extends LitElement implements ActionElement {
"ui.panel.config.automation.editor.actions.type.choose.sequence" "ui.panel.config.automation.editor.actions.type.choose.sequence"
)}: )}:
</h3> </h3>
<ha-form <ha-automation-action
.actions=${option.sequence || []}
.reOrderMode=${this.reOrderMode}
.hass=${this.hass} .hass=${this.hass}
.schema=${[{ name: "sequence", selector: { action: {} } }]}
.data=${option}
.idx=${idx} .idx=${idx}
@value-changed=${this._actionChanged} @value-changed=${this._actionChanged}
></ha-form> ></ha-automation-action>
</div> </div>
</ha-card>` </ha-card>`
)} )}
@ -126,7 +125,7 @@ export class HaChooseAction extends LitElement implements ActionElement {
private _actionChanged(ev: CustomEvent) { private _actionChanged(ev: CustomEvent) {
ev.stopPropagation(); ev.stopPropagation();
const value = ev.detail.value.sequence as Action[]; const value = ev.detail.value as Action[];
const index = (ev.target as any).idx; const index = (ev.target as any).idx;
const choose = this.action.choose const choose = this.action.choose
? [...ensureArray(this.action.choose)] ? [...ensureArray(this.action.choose)]
@ -185,9 +184,6 @@ export class HaChooseAction extends LitElement implements ActionElement {
right: 0; right: 0;
padding: 4px; padding: 4px;
} }
ha-form::part(root) {
overflow: visible;
}
ha-svg-icon { ha-svg-icon {
height: 20px; height: 20px;
} }