mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Fix entity picker delete button (#20875)
This commit is contained in:
parent
f59ed0a72b
commit
6ccbeb8a75
@ -405,9 +405,9 @@ export class HaEntityPicker extends LitElement {
|
|||||||
this._opened = ev.detail.value;
|
this._opened = ev.detail.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _valueChanged(ev: ValueChangedEvent<string>) {
|
private _valueChanged(ev: ValueChangedEvent<string | undefined>) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
const newValue = ev.detail.value.trim();
|
const newValue = ev.detail.value?.trim();
|
||||||
|
|
||||||
if (newValue && newValue.startsWith(CREATE_ID)) {
|
if (newValue && newValue.startsWith(CREATE_ID)) {
|
||||||
const domain = newValue.substring(CREATE_ID.length);
|
const domain = newValue.substring(CREATE_ID.length);
|
||||||
@ -433,7 +433,7 @@ export class HaEntityPicker extends LitElement {
|
|||||||
: this._states;
|
: this._states;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _setValue(value: string) {
|
private _setValue(value: string | undefined) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
fireEvent(this, "value-changed", { value });
|
fireEvent(this, "value-changed", { value });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user