Fix select box radio click on firefox (#24422)

This commit is contained in:
Paul Bottein 2025-02-27 13:08:16 +01:00 committed by GitHub
parent 3d9bde548d
commit a5b7f2466e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@ import type { HaRadio } from "./ha-radio";
import { fireEvent } from "../common/dom/fire_event";
import type { HomeAssistant } from "../types";
import { computeRTL } from "../common/util/compute_rtl";
import { stopPropagation } from "../common/dom/stop_propagation";
interface SelectBoxOptionImage {
src: string;
@ -76,6 +77,7 @@ export class HaSelectBox extends LitElement {
.value=${option.value}
.disabled=${disabled}
@change=${this._radioChanged}
@click=${stopPropagation}
></ha-radio>
<div class="text">
<span class="label">${option.label}</span>
@ -99,6 +101,7 @@ export class HaSelectBox extends LitElement {
}
private _radioChanged(ev: CustomEvent) {
ev.stopPropagation();
const radio = ev.currentTarget as HaRadio;
const value = radio.value;
if (this.disabled || value === undefined || value === (this.value ?? "")) {