From 1f15094da7f653225467631227647c1c37eae6c5 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 1 Jul 2020 11:35:38 +0200 Subject: [PATCH] More scrolling restore fixes, and fix custom panel iframe check (#6290) --- src/layouts/partial-panel-resolver.ts | 3 +-- src/panels/calendar/ha-panel-calendar.ts | 2 +- src/panels/config/dashboard/ha-config-dashboard.ts | 2 +- .../integration-panels/zwave/ha-config-zwave.js | 2 +- .../developer-tools/ha-panel-developer-tools.ts | 2 +- src/panels/history/ha-panel-history.ts | 2 +- src/panels/logbook/ha-logbook.ts | 12 +++++++++++- src/panels/logbook/ha-panel-logbook.ts | 2 +- src/panels/lovelace/hui-root.ts | 1 - src/panels/mailbox/ha-panel-mailbox.js | 2 +- src/panels/profile/ha-panel-profile.ts | 2 +- src/panels/shopping-list/ha-panel-shopping-list.js | 2 +- 12 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/layouts/partial-panel-resolver.ts b/src/layouts/partial-panel-resolver.ts index 166f3b7a91..a2db064c91 100644 --- a/src/layouts/partial-panel-resolver.ts +++ b/src/layouts/partial-panel-resolver.ts @@ -185,8 +185,7 @@ class PartialPanelResolver extends HassRouterPage { curPanel.component_name !== "iframe" && // Do not disconnect any custom panel that embeds into iframe (ie hassio) (curPanel.component_name !== "custom" || - !(curPanel.config as CustomPanelInfo).config._panel_custom - .embed_iframe) + !(curPanel as CustomPanelInfo).config._panel_custom.embed_iframe) ) { this._disconnectedPanel = this.lastChild as HTMLElement; const activeEl = deepActiveElement( diff --git a/src/panels/calendar/ha-panel-calendar.ts b/src/panels/calendar/ha-panel-calendar.ts index ae77545aa9..7c4232bfa3 100644 --- a/src/panels/calendar/ha-panel-calendar.ts +++ b/src/panels/calendar/ha-panel-calendar.ts @@ -62,7 +62,7 @@ class PanelCalendar extends LitElement { protected render(): TemplateResult { return html` - + + - + + + +
${scroll({ items: this.entries, renderItem: (item: LogbookEntry, index?: number) => @@ -116,6 +121,11 @@ class HaLogbook extends LitElement { `; } + @eventOptions({ passive: true }) + private _saveScrollPos(e: Event) { + this._savedScrollPos = (e.target as HTMLDivElement).scrollTop; + } + private _entityClicked(ev: Event) { ev.preventDefault(); fireEvent(this, "hass-more-info", { diff --git a/src/panels/logbook/ha-panel-logbook.ts b/src/panels/logbook/ha-panel-logbook.ts index 8adb2a6c82..b51c07d50c 100644 --- a/src/panels/logbook/ha-panel-logbook.ts +++ b/src/panels/logbook/ha-panel-logbook.ts @@ -72,7 +72,7 @@ export class HaPanelLogbook extends LitElement { protected render() { return html` - + - + + - +