From 37b79c67c95bafb14e7622e5f5396a88b81ea3bb Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Fri, 9 May 2025 17:26:54 +0200 Subject: [PATCH] Fix search --- src/components/ha-area-combo-box.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/ha-area-combo-box.ts b/src/components/ha-area-combo-box.ts index 2d969feb6e..a6ad766445 100644 --- a/src/components/ha-area-combo-box.ts +++ b/src/components/ha-area-combo-box.ts @@ -313,7 +313,7 @@ export class HaAreaComboBox extends LitElement { label: "", id: NO_ITEMS_ID, 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.length === 0) { - if (!this.noAdd) { + if (this.noAdd) { this.comboBox.filteredItems = [ { id: NO_ITEMS_ID, primary: this.hass.localize("ui.components.area-picker.no_match"), - icon: "mdi:search", + icon: "mdi:magnify", }, ] as AreaComboBoxItem[]; } else { @@ -420,6 +420,8 @@ export class HaAreaComboBox extends LitElement { }, ] as AreaComboBoxItem[]; } + } else { + target.filteredItems = results.map((result) => result.item); } } else { this.comboBox.filteredItems = target.items as AreaComboBoxItem[];