mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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 { computeDomain } from "../common/entity/compute_domain";
|
||||
import { computeStateName } from "../common/entity/compute_state_name";
|
||||
import { isValidEntityId } from "../common/entity/valid_entity_id";
|
||||
import {
|
||||
computeDeviceName,
|
||||
DeviceRegistryEntry,
|
||||
@ -351,6 +352,11 @@ export class HaTargetPicker extends LitElement {
|
||||
}
|
||||
const value = ev.detail.value;
|
||||
const target = ev.currentTarget;
|
||||
|
||||
if (target.type === "entity_id" && !isValidEntityId(value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
target.value = "";
|
||||
if (
|
||||
this.value &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user