mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
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 <MindFreeze@users.noreply.github.com> --------- Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
This commit is contained in:
parent
8b87188075
commit
4b72a6029c
@ -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 });
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user