From d66a8a65b6408f39c3d3c5654e612fcee6fcf173 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Mon, 10 Jul 2023 04:13:46 -0700 Subject: [PATCH] Fix a browser hang with charts in grids (#17244) --- src/components/chart/state-history-charts.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/chart/state-history-charts.ts b/src/components/chart/state-history-charts.ts index 0ce32a583e..2ed678b01c 100644 --- a/src/components/chart/state-history-charts.ts +++ b/src/components/chart/state-history-charts.ts @@ -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() {