From 48fa241242cabb9bc3e41738b840defc6c491678 Mon Sep 17 00:00:00 2001 From: Patrick Masters Date: Mon, 26 May 2025 11:40:09 -0400 Subject: [PATCH] Add stopPropagation to other state-cards --- src/state-summary/state-card-input_number.ts | 3 +++ src/state-summary/state-card-number.ts | 9 ++++++--- src/state-summary/state-card-select.ts | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/state-summary/state-card-input_number.ts b/src/state-summary/state-card-input_number.ts index 39497ead04..e87705249a 100644 --- a/src/state-summary/state-card-input_number.ts +++ b/src/state-summary/state-card-input_number.ts @@ -2,6 +2,7 @@ import type { HassEntity } from "home-assistant-js-websocket"; import type { TemplateResult } from "lit"; import { css, html, LitElement } from "lit"; import { customElement, property } from "lit/decorators"; +import { stopPropagation } from "../common/dom/stop_propagation"; import { debounce } from "../common/util/debounce"; import "../components/entity/state-info"; import "../components/ha-slider"; @@ -63,6 +64,7 @@ class StateCardInputNumber extends LitElement { .max=${Number(this.stateObj.attributes.max)} .value=${this.stateObj.state} @change=${this._selectedValueChanged} + @click=${stopPropagation} > ${this.hass.formatEntityState(this.stateObj)} @@ -81,6 +83,7 @@ class StateCardInputNumber extends LitElement { .suffix=${this.stateObj.attributes.unit_of_measurement || ""} type="number" @change=${this._selectedValueChanged} + @click=${stopPropagation} > diff --git a/src/state-summary/state-card-number.ts b/src/state-summary/state-card-number.ts index c722127846..be715eab0b 100644 --- a/src/state-summary/state-card-number.ts +++ b/src/state-summary/state-card-number.ts @@ -2,13 +2,14 @@ import type { HassEntity } from "home-assistant-js-websocket"; import type { CSSResultGroup } from "lit"; import { css, html, LitElement } from "lit"; import { customElement, property } from "lit/decorators"; +import { stopPropagation } from "../common/dom/stop_propagation"; +import { debounce } from "../common/util/debounce"; import "../components/entity/state-info"; import "../components/ha-slider"; import "../components/ha-textfield"; -import type { HomeAssistant } from "../types"; -import { haStyle } from "../resources/styles"; import { isUnavailableState } from "../data/entity"; -import { debounce } from "../common/util/debounce"; +import { haStyle } from "../resources/styles"; +import type { HomeAssistant } from "../types"; @customElement("state-card-number") class StateCardNumber extends LitElement { @@ -66,6 +67,7 @@ class StateCardNumber extends LitElement { .max=${Number(this.stateObj.attributes.max)} .value=${this.stateObj.state} @change=${this._selectedValueChanged} + @click=${stopPropagation} > @@ -84,6 +86,7 @@ class StateCardNumber extends LitElement { .suffix=${this.stateObj.attributes.unit_of_measurement || ""} type="number" @change=${this._selectedValueChanged} + @click=${stopPropagation} > `} diff --git a/src/state-summary/state-card-select.ts b/src/state-summary/state-card-select.ts index 9027a17100..22aeee8502 100644 --- a/src/state-summary/state-card-select.ts +++ b/src/state-summary/state-card-select.ts @@ -29,6 +29,7 @@ class StateCardSelect extends LitElement { fixedMenuPosition @selected=${this._selectedOptionChanged} @closed=${stopPropagation} + @click=${stopPropagation} > ${this.stateObj.attributes.options.map( (option) => html`