mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Block target picker from adding badly formatted entity (fix history crash) (#15509)
This commit is contained in:
parent
e21816be52
commit
05f2fb896c
@ -18,6 +18,7 @@ import { ensureArray } from "../common/array/ensure-array";
|
|||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
import { computeDomain } from "../common/entity/compute_domain";
|
import { computeDomain } from "../common/entity/compute_domain";
|
||||||
import { computeStateName } from "../common/entity/compute_state_name";
|
import { computeStateName } from "../common/entity/compute_state_name";
|
||||||
|
import { isValidEntityId } from "../common/entity/valid_entity_id";
|
||||||
import {
|
import {
|
||||||
computeDeviceName,
|
computeDeviceName,
|
||||||
DeviceRegistryEntry,
|
DeviceRegistryEntry,
|
||||||
@ -351,6 +352,11 @@ export class HaTargetPicker extends LitElement {
|
|||||||
}
|
}
|
||||||
const value = ev.detail.value;
|
const value = ev.detail.value;
|
||||||
const target = ev.currentTarget;
|
const target = ev.currentTarget;
|
||||||
|
|
||||||
|
if (target.type === "entity_id" && !isValidEntityId(value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
target.value = "";
|
target.value = "";
|
||||||
if (
|
if (
|
||||||
this.value &&
|
this.value &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user