Fix search

This commit is contained in:
Paul Bottein 2025-05-09 17:26:54 +02:00
parent 0715835e0d
commit 37b79c67c9
No known key found for this signature in database

View File

@ -313,7 +313,7 @@ export class HaAreaComboBox extends LitElement {
label: "", label: "",
id: NO_ITEMS_ID, id: NO_ITEMS_ID,
primary: this.hass.localize("ui.components.area-picker.no_areas"), primary: this.hass.localize("ui.components.area-picker.no_areas"),
icon: undefined, icon: "mdi:magnify",
}, },
]; ];
} }
@ -399,12 +399,12 @@ export class HaAreaComboBox extends LitElement {
if (results) { if (results) {
if (results.length === 0) { if (results.length === 0) {
if (!this.noAdd) { if (this.noAdd) {
this.comboBox.filteredItems = [ this.comboBox.filteredItems = [
{ {
id: NO_ITEMS_ID, id: NO_ITEMS_ID,
primary: this.hass.localize("ui.components.area-picker.no_match"), primary: this.hass.localize("ui.components.area-picker.no_match"),
icon: "mdi:search", icon: "mdi:magnify",
}, },
] as AreaComboBoxItem[]; ] as AreaComboBoxItem[];
} else { } else {
@ -420,6 +420,8 @@ export class HaAreaComboBox extends LitElement {
}, },
] as AreaComboBoxItem[]; ] as AreaComboBoxItem[];
} }
} else {
target.filteredItems = results.map((result) => result.item);
} }
} else { } else {
this.comboBox.filteredItems = target.items as AreaComboBoxItem[]; this.comboBox.filteredItems = target.items as AreaComboBoxItem[];