mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 05:27:46 +00:00
Fix search
This commit is contained in:
parent
0715835e0d
commit
37b79c67c9
@ -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[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user