From 84938ccc94e50b6528a222895da375daba3251d9 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Thu, 15 Feb 2024 04:04:40 -0500 Subject: [PATCH] stopPropagation on automation moveUp/moveDown (#19804) * stopPropagation on automation moveUp/moveDown * also conditions and triggers --- src/panels/config/automation/action/ha-automation-action.ts | 2 ++ .../config/automation/condition/ha-automation-condition.ts | 2 ++ src/panels/config/automation/trigger/ha-automation-trigger.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/panels/config/automation/action/ha-automation-action.ts b/src/panels/config/automation/action/ha-automation-action.ts index 2cf2984cbe..2722574ac0 100644 --- a/src/panels/config/automation/action/ha-automation-action.ts +++ b/src/panels/config/automation/action/ha-automation-action.ts @@ -203,12 +203,14 @@ export default class HaAutomationAction extends LitElement { } private _moveUp(ev) { + ev.stopPropagation(); const index = (ev.target as any).index; const newIndex = index - 1; this._move(index, newIndex); } private _moveDown(ev) { + ev.stopPropagation(); const index = (ev.target as any).index; const newIndex = index + 1; this._move(index, newIndex); diff --git a/src/panels/config/automation/condition/ha-automation-condition.ts b/src/panels/config/automation/condition/ha-automation-condition.ts index a615f9a1b4..d164a6ee21 100644 --- a/src/panels/config/automation/condition/ha-automation-condition.ts +++ b/src/panels/config/automation/condition/ha-automation-condition.ts @@ -227,12 +227,14 @@ export default class HaAutomationCondition extends LitElement { } private _moveUp(ev) { + ev.stopPropagation(); const index = (ev.target as any).index; const newIndex = index - 1; this._move(index, newIndex); } private _moveDown(ev) { + ev.stopPropagation(); const index = (ev.target as any).index; const newIndex = index + 1; this._move(index, newIndex); diff --git a/src/panels/config/automation/trigger/ha-automation-trigger.ts b/src/panels/config/automation/trigger/ha-automation-trigger.ts index 4da764f879..65935d8f5d 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger.ts @@ -180,12 +180,14 @@ export default class HaAutomationTrigger extends LitElement { } private _moveUp(ev) { + ev.stopPropagation(); const index = (ev.target as any).index; const newIndex = index - 1; this._move(index, newIndex); } private _moveDown(ev) { + ev.stopPropagation(); const index = (ev.target as any).index; const newIndex = index + 1; this._move(index, newIndex);