From 67a93013c78254b842be2857c03ea8872a87729a Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:22:40 +0200 Subject: [PATCH] Revert "Fix drag and drop when using action and trigger selector" (#22296) Revert "Fix drag and drop when using action and trigger selector (#22291)" This reverts commit 99035cea8fb2676a14da92434bfebdc6c7cb9c4b. --- .../ha-selector/ha-selector-action.ts | 17 +++++++---------- .../ha-selector/ha-selector-trigger.ts | 17 +++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/components/ha-selector/ha-selector-action.ts b/src/components/ha-selector/ha-selector-action.ts index 1e96086796..23d93a2a29 100644 --- a/src/components/ha-selector/ha-selector-action.ts +++ b/src/components/ha-selector/ha-selector-action.ts @@ -4,7 +4,7 @@ import memoizeOne from "memoize-one"; import { Action, migrateAutomationAction } from "../../data/script"; import { ActionSelector } from "../../data/selector"; import "../../panels/config/automation/action/ha-automation-action"; -import { HomeAssistant, ItemPath } from "../../types"; +import { HomeAssistant } from "../../types"; @customElement("ha-selector-action") export class HaActionSelector extends LitElement { @@ -18,22 +18,19 @@ export class HaActionSelector extends LitElement { @property({ type: Boolean, reflect: true }) public disabled = false; - // Add path here to ignore memoize if the path changes - private _actions = memoizeOne( - (action: Action | undefined, _path?: ItemPath) => { - if (!action) { - return []; - } - return migrateAutomationAction(action); + private _actions = memoizeOne((action: Action | undefined) => { + if (!action) { + return []; } - ); + return migrateAutomationAction(action); + }); protected render() { return html` ${this.label ? html`` : nothing} diff --git a/src/components/ha-selector/ha-selector-trigger.ts b/src/components/ha-selector/ha-selector-trigger.ts index 2bddf4ffd9..0974a31702 100644 --- a/src/components/ha-selector/ha-selector-trigger.ts +++ b/src/components/ha-selector/ha-selector-trigger.ts @@ -4,7 +4,7 @@ import memoizeOne from "memoize-one"; import { migrateAutomationTrigger, Trigger } from "../../data/automation"; import { TriggerSelector } from "../../data/selector"; import "../../panels/config/automation/trigger/ha-automation-trigger"; -import { HomeAssistant, ItemPath } from "../../types"; +import { HomeAssistant } from "../../types"; @customElement("ha-selector-trigger") export class HaTriggerSelector extends LitElement { @@ -18,22 +18,19 @@ export class HaTriggerSelector extends LitElement { @property({ type: Boolean, reflect: true }) public disabled = false; - // Add path here to ignore memoize if the path changes - private _triggers = memoizeOne( - (trigger: Trigger | undefined, _path?: ItemPath) => { - if (!trigger) { - return []; - } - return migrateAutomationTrigger(trigger); + private _triggers = memoizeOne((trigger: Trigger | undefined) => { + if (!trigger) { + return []; } - ); + return migrateAutomationTrigger(trigger); + }); protected render() { return html` ${this.label ? html`` : nothing}