mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 10:59:50 +00:00
Add automation element dialog: fix blocks only search result (#27618)
Fix exact block search
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user