diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 4d454bff49..da6a0ccb5c 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -144,10 +144,12 @@ export class MoreInfoDialog extends LitElement { public closeDialog() { this._entityId = undefined; + this._parentEntityIds = []; this._entry = undefined; - this._childView = undefined; this._infoEditMode = false; this._initialView = DEFAULT_VIEW; + this._currView = DEFAULT_VIEW; + this._childView = undefined; this._isEscapeEnabled = true; window.removeEventListener("dialog-closed", this._enableEscapeKeyClose); window.removeEventListener("show-dialog", this._disableEscapeKeyClose); @@ -527,67 +529,69 @@ export class MoreInfoDialog extends LitElement { ` : nothing} -
- ${keyed( - this._entityId, - cache( - this._childView - ? html` -
- ${dynamicElement(this._childView.viewTag, { - hass: this.hass, - entry: this._entry, - params: this._childView.viewParams, - })} -
- ` - : this._currView === "info" + ${keyed( + this._entityId, + html` +
+ ${cache( + this._childView ? html` - +
+ ${dynamicElement(this._childView.viewTag, { + hass: this.hass, + entry: this._entry, + params: this._childView.viewParams, + })} +
` - : this._currView === "history" + : this._currView === "info" ? html` - + .entry=${this._entry} + .editMode=${this._infoEditMode} + > ` - : this._currView === "settings" + : this._currView === "history" ? html` - + > ` - : this._currView === "related" + : this._currView === "settings" ? html` - + .entityId=${this._entityId} + .entry=${this._entry} + > ` - : nothing - ) - )} -
+ : this._currView === "related" + ? html` + + ` + : nothing + )} +
+ ` + )} `; }