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