Do not hide overflow in expansion panel when expanded (#13423)

This commit is contained in:
Paulus Schoutsen 2022-08-20 14:38:03 -04:00 committed by GitHub
parent 209ba79823
commit 5ecde44243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;