diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts index 211d608332..74f0151a2e 100644 --- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts +++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts @@ -303,6 +303,10 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard { } private _measureCard() { + if (!this.isConnected) { + return; + } + this._narrow = this.offsetWidth < 375; if (this.offsetWidth < 300) { this.setAttribute("verynarrow", "");