Fix tooltip scrolling (#23616)

This commit is contained in:
Petar Petrov 2025-01-07 14:44:56 +02:00 committed by GitHub
parent 617480472e
commit 7133dc5688
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,11 +83,13 @@ export class HaChartBase extends LitElement {
public disconnectedCallback() {
super.disconnectedCallback();
window.removeEventListener("scroll", this._handleScroll, true);
this._releaseCanvas();
}
public connectedCallback() {
super.connectedCallback();
window.addEventListener("scroll", this._handleScroll, true);
if (this.hasUpdated) {
this._releaseCanvas();
this._setupChart();
@ -561,6 +563,10 @@ export class HaChartBase extends LitElement {
this.chart?.resetZoom();
}
private _handleScroll = () => {
this._tooltip = undefined;
};
static get styles(): CSSResultGroup {
return css`
:host {