From 4b72a6029cc39ffcb3c684d12d9465f9fb4ddd71 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Mon, 19 May 2025 06:36:46 -0700 Subject: [PATCH] Fix stack editor bugs (#25501) * Fix stack editor bugs * Update src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts Co-authored-by: Petar Petrov --------- Co-authored-by: Petar Petrov --- .../editor/config-elements/hui-stack-card-editor.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts index a13d52d990..236c695c7b 100644 --- a/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts @@ -219,7 +219,7 @@ export class HuiStackCardEditor } private _getKey(cards: LovelaceCardConfig[], index: number): string { - const key = `${cards[index].type}${index}${cards.length}`; + const key = `${index}-${cards.length}`; if (!this._keys.has(key)) { this._keys.set(key, Math.random().toString()); } @@ -234,7 +234,7 @@ export class HuiStackCardEditor } protected _handleSelectedCard(ev) { - this._setMode(true); + this._GUImode = true; this._guiModeAvailable = true; this._selectedCard = parseInt(ev.detail.name, 10); } @@ -317,13 +317,6 @@ export class HuiStackCardEditor this._cardEditorEl?.toggleMode(); } - protected _setMode(value: boolean): void { - this._GUImode = value; - if (this._cardEditorEl) { - this._cardEditorEl!.GUImode = value; - } - } - protected _valueChanged(ev: CustomEvent): void { fireEvent(this, "config-changed", { config: ev.detail.value }); }