mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Add message in picker when no entities found
This commit is contained in:
parent
f9fbb254bf
commit
498d933c06
@ -499,7 +499,20 @@ export class HaEntityComboBox extends LitElement {
|
|||||||
|
|
||||||
const results = fuse.multiTermsSearch(filterString);
|
const results = fuse.multiTermsSearch(filterString);
|
||||||
if (results) {
|
if (results) {
|
||||||
target.filteredItems = results.map((result) => result.item);
|
if (results.length === 0) {
|
||||||
|
target.filteredItems = [
|
||||||
|
{
|
||||||
|
...FAKE_ENTITY,
|
||||||
|
label: "",
|
||||||
|
primary: this.hass!.localize(
|
||||||
|
"ui.components.entity.entity-picker.no_match"
|
||||||
|
),
|
||||||
|
icon_path: mdiMagnify,
|
||||||
|
},
|
||||||
|
] as EntityComboBoxItem[];
|
||||||
|
} else {
|
||||||
|
target.filteredItems = results.map((result) => result.item);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
target.filteredItems = this._items;
|
target.filteredItems = this._items;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user