Fix a browser hang with charts in grids (#17244)

This commit is contained in:
karwosts 2023-07-10 04:13:46 -07:00 committed by GitHub
parent 3bf8739a7c
commit d66a8a65b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,7 +184,17 @@ export class StateHistoryCharts extends LitElement {
};
protected shouldUpdate(changedProps: PropertyValues): boolean {
return !(changedProps.size === 1 && changedProps.has("hass"));
if (changedProps.size === 1 && changedProps.has("hass")) {
return false;
}
if (
changedProps.size === 1 &&
changedProps.has("_maxYWidth") &&
changedProps.get("_maxYWidth") === this._maxYWidth
) {
return false;
}
return true;
}
protected willUpdate() {