mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 21:17:47 +00:00
Force editor rebuild on stack card switch
This commit is contained in:
parent
498732566e
commit
aecbfeaaa0
@ -167,6 +167,9 @@ export class HuiStackCardEditor
|
|||||||
this._setMode(true);
|
this._setMode(true);
|
||||||
this._guiModeAvailable = true;
|
this._guiModeAvailable = true;
|
||||||
this._selectedCard = parseInt(ev.detail.selected, 10);
|
this._selectedCard = parseInt(ev.detail.selected, 10);
|
||||||
|
if (this._cardEditorEl) {
|
||||||
|
this._cardEditorEl.forceRebuild = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected _handleConfigChanged(ev: HASSDomEvent<ConfigChangedEvent>) {
|
protected _handleConfigChanged(ev: HASSDomEvent<ConfigChangedEvent>) {
|
||||||
|
@ -53,6 +53,8 @@ export abstract class HuiElementEditor<T> extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public lovelace?: LovelaceConfig;
|
@property({ attribute: false }) public lovelace?: LovelaceConfig;
|
||||||
|
|
||||||
|
public forceRebuild = false;
|
||||||
|
|
||||||
@state() private _yaml?: string;
|
@state() private _yaml?: string;
|
||||||
|
|
||||||
@state() private _config?: T;
|
@state() private _config?: T;
|
||||||
@ -292,7 +294,11 @@ export abstract class HuiElementEditor<T> extends LitElement {
|
|||||||
this._errors = undefined;
|
this._errors = undefined;
|
||||||
this._warnings = undefined;
|
this._warnings = undefined;
|
||||||
|
|
||||||
if (this._configElementType !== this.configElementType) {
|
if (
|
||||||
|
this._configElementType !== this.configElementType ||
|
||||||
|
this.forceRebuild
|
||||||
|
) {
|
||||||
|
this.forceRebuild = false;
|
||||||
// If the type has changed, we need to load a new GUI editor
|
// If the type has changed, we need to load a new GUI editor
|
||||||
this._guiSupported = undefined;
|
this._guiSupported = undefined;
|
||||||
this._configElement = undefined;
|
this._configElement = undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user