From 5ecde44243ff5237ffcf0a57bea9eb022cb19060 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 20 Aug 2022 14:38:03 -0400 Subject: [PATCH] Do not hide overflow in expansion panel when expanded (#13423) --- src/components/ha-expansion-panel.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/ha-expansion-panel.ts b/src/components/ha-expansion-panel.ts index 8510584584..8c0fd25539 100644 --- a/src/components/ha-expansion-panel.ts +++ b/src/components/ha-expansion-panel.ts @@ -85,11 +85,18 @@ export class HaExpansionPanel extends LitElement { super.willUpdate(changedProps); if (changedProps.has("expanded") && this.expanded) { this._showContent = this.expanded; + setTimeout(() => { + // Verify we're still expanded + if (this.expanded) { + this._container.style.overflow = "initial"; + } + }, 300); } } private _handleTransitionEnd() { this._container.style.removeProperty("height"); + this._container.style.overflow = this.expanded ? "initial" : "hidden"; this._showContent = this.expanded; } @@ -103,6 +110,7 @@ export class HaExpansionPanel extends LitElement { ev.preventDefault(); const newExpanded = !this.expanded; fireEvent(this, "expanded-will-change", { expanded: newExpanded }); + this._container.style.overflow = "hidden"; if (newExpanded) { this._showContent = true;