Fix ha-devices-picker when changing or deleting devices (#16739)

This commit is contained in:
karwosts 2023-06-06 12:28:07 -07:00 committed by GitHub
parent 19fc92419a
commit 76255f2efb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,10 +111,10 @@ class HaDevicesPicker extends LitElement {
event.stopPropagation();
const curValue = (event.currentTarget as any).curValue;
const newValue = event.detail.value;
if (newValue === curValue || newValue !== "") {
if (newValue === curValue) {
return;
}
if (newValue === "") {
if (newValue === undefined) {
this._updateDevices(
this._currentDevices.filter((dev) => dev !== curValue)
);