mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Fix select box radio click on firefox (#24422)
This commit is contained in:
parent
3d9bde548d
commit
a5b7f2466e
@ -7,6 +7,7 @@ import type { HaRadio } from "./ha-radio";
|
|||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
import type { HomeAssistant } from "../types";
|
import type { HomeAssistant } from "../types";
|
||||||
import { computeRTL } from "../common/util/compute_rtl";
|
import { computeRTL } from "../common/util/compute_rtl";
|
||||||
|
import { stopPropagation } from "../common/dom/stop_propagation";
|
||||||
|
|
||||||
interface SelectBoxOptionImage {
|
interface SelectBoxOptionImage {
|
||||||
src: string;
|
src: string;
|
||||||
@ -76,6 +77,7 @@ export class HaSelectBox extends LitElement {
|
|||||||
.value=${option.value}
|
.value=${option.value}
|
||||||
.disabled=${disabled}
|
.disabled=${disabled}
|
||||||
@change=${this._radioChanged}
|
@change=${this._radioChanged}
|
||||||
|
@click=${stopPropagation}
|
||||||
></ha-radio>
|
></ha-radio>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<span class="label">${option.label}</span>
|
<span class="label">${option.label}</span>
|
||||||
@ -99,6 +101,7 @@ export class HaSelectBox extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _radioChanged(ev: CustomEvent) {
|
private _radioChanged(ev: CustomEvent) {
|
||||||
|
ev.stopPropagation();
|
||||||
const radio = ev.currentTarget as HaRadio;
|
const radio = ev.currentTarget as HaRadio;
|
||||||
const value = radio.value;
|
const value = radio.value;
|
||||||
if (this.disabled || value === undefined || value === (this.value ?? "")) {
|
if (this.disabled || value === undefined || value === (this.value ?? "")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user