diff --git a/src/weather-forecast-card.css b/src/weather-forecast-card.css index 88ebc04..a016ddd 100644 --- a/src/weather-forecast-card.css +++ b/src/weather-forecast-card.css @@ -211,6 +211,10 @@ ha-card { } .wfc-forecast-container { + pointer-events: auto; +} + +.wfc-forecast-container.is-scrollable { --mask: linear-gradient( to right, rgba(0, 0, 0, 0) 0, @@ -218,7 +222,6 @@ ha-card { rgba(0, 0, 0, 1) calc(100% - var(--fade-width)), rgba(0, 0, 0, 0) 100% ); - pointer-events: auto; -webkit-mask: var(--mask); mask: var(--mask); } diff --git a/src/weather-forecast-card.ts b/src/weather-forecast-card.ts index 14fa8e5..655a66a 100644 --- a/src/weather-forecast-card.ts +++ b/src/weather-forecast-card.ts @@ -5,6 +5,7 @@ import { createWarningText, normalizeDate } from "./helpers"; import { logger } from "./logger"; import { actionHandler, isInvalidEntityIdError } from "./hass"; import { ForecastActionEvent, ForecastMode } from "./types"; +import { classMap } from "lit/directives/class-map.js"; import { LitElement, html, @@ -66,6 +67,7 @@ export class WeatherForecastCard extends LitElement { @state() private _hourlyForecastEvent?: ForecastEvent | undefined; @state() private _currentItemWidth!: number; @state() private _currentForecastType: ForecastType = "daily"; + @state() private _isScrollable = false; private _hourlyForecastData?: ForecastAttribute[]; private _dailyForecastData?: ForecastAttribute[]; @@ -138,7 +140,8 @@ export class WeatherForecastCard extends LitElement { changedProperties.has("_dailyForecastEvent") || changedProperties.has("_hourlyForecastEvent") || changedProperties.has("_currentForecastType") || - changedProperties.has("_currentItemWidth") + changedProperties.has("_currentItemWidth") || + changedProperties.has("_isScrollable") ); } @@ -216,7 +219,10 @@ export class WeatherForecastCard extends LitElement { ${this.config.show_forecast === false ? nothing : html`