mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Only show heading divider on more info dialog scroll (#15545)
This commit is contained in:
parent
3158e6043d
commit
e697a09e53
@ -40,6 +40,21 @@ export class HaDialog extends DialogBase {
|
|||||||
this.suppressDefaultPressSelector,
|
this.suppressDefaultPressSelector,
|
||||||
SUPPRESS_DEFAULT_PRESS_SELECTOR,
|
SUPPRESS_DEFAULT_PRESS_SELECTOR,
|
||||||
].join(", ");
|
].join(", ");
|
||||||
|
this._updateScrolledAttribute();
|
||||||
|
this.contentElement?.addEventListener("scroll", this._onScroll);
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnectedCallback(): void {
|
||||||
|
this.contentElement.removeEventListener("scroll", this._onScroll);
|
||||||
|
}
|
||||||
|
|
||||||
|
private _onScroll = () => {
|
||||||
|
this._updateScrolledAttribute();
|
||||||
|
};
|
||||||
|
|
||||||
|
private _updateScrolledAttribute() {
|
||||||
|
if (!this.contentElement) return;
|
||||||
|
this.toggleAttribute("scrolled", this.contentElement.scrollTop !== 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static override styles = [
|
static override styles = [
|
||||||
|
@ -421,7 +421,7 @@ export class MoreInfoDialog extends LitElement {
|
|||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.heading {
|
ha-dialog[scrolled] .heading {
|
||||||
border-bottom: 1px solid
|
border-bottom: 1px solid
|
||||||
var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12));
|
var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user