Add automation element dialog: fix blocks only search result (#27618)

Fix exact block search
This commit is contained in:
Wendelin
2025-10-24 10:25:39 +02:00
committed by GitHub
parent 4e6e3629a8
commit 221ca56121

View File

@@ -846,7 +846,8 @@ class DialogAddAutomationElement
items: true, items: true,
blank: blank:
!this._selectedGroup && !this._filter && this._tab === "groups", !this._selectedGroup && !this._filter && this._tab === "groups",
"empty-search": !items?.length && this._filter, "empty-search":
!items?.length && !filteredBlockItems?.length && this._filter,
hidden: hidden:
this._narrow && this._narrow &&
!this._selectedGroup && !this._selectedGroup &&
@@ -855,7 +856,7 @@ class DialogAddAutomationElement
})} })}
@scroll=${this._onItemsScroll} @scroll=${this._onItemsScroll}
> >
${filteredBlockItems && filteredBlockItems.length ${filteredBlockItems
? this._renderItemList( ? this._renderItemList(
this.hass.localize(`ui.panel.config.automation.editor.blocks`), this.hass.localize(`ui.panel.config.automation.editor.blocks`),
filteredBlockItems filteredBlockItems
@@ -888,7 +889,7 @@ class DialogAddAutomationElement
} }
private _renderItemList(title, items?: ListItem[]) { private _renderItemList(title, items?: ListItem[]) {
if (!items) { if (!items || !items.length) {
return nothing; return nothing;
} }
@@ -1117,11 +1118,6 @@ class DialogAddAutomationElement
padding: 0; padding: 0;
} }
.items ha-md-list,
.groups {
padding-bottom: max(var(--safe-area-inset-bottom), var(--ha-space-3));
}
.groups { .groups {
overflow: auto; overflow: auto;
flex: 3; flex: 3;
@@ -1206,6 +1202,11 @@ class DialogAddAutomationElement
border: 1px solid var(--ha-color-border-neutral-quiet); border: 1px solid var(--ha-color-border-neutral-quiet);
} }
.items ha-md-list,
.groups {
padding-bottom: max(var(--safe-area-inset-bottom), var(--ha-space-3));
}
.items.blank { .items.blank {
justify-content: center; justify-content: center;
} }