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._guiModeAvailable = true;
|
||||
this._selectedCard = parseInt(ev.detail.selected, 10);
|
||||
if (this._cardEditorEl) {
|
||||
this._cardEditorEl.forceRebuild = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected _handleConfigChanged(ev: HASSDomEvent<ConfigChangedEvent>) {
|
||||
|
|
|
@ -53,6 +53,8 @@ export abstract class HuiElementEditor<T> extends LitElement {
|
|||
|
||||
@property({ attribute: false }) public lovelace?: LovelaceConfig;
|
||||
|
||||
public forceRebuild = false;
|
||||
|
||||
@state() private _yaml?: string;
|
||||
|
||||
@state() private _config?: T;
|
||||
|
@ -292,7 +294,11 @@ export abstract class HuiElementEditor<T> extends LitElement {
|
|||
this._errors = 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
|
||||
this._guiSupported = undefined;
|
||||
this._configElement = undefined;
|
||||
|
|
Loading…
Reference in New Issue