Fix search for labels and categories (#20262)
This commit is contained in:
parent
1300cffa3b
commit
510e010f97
|
@ -385,8 +385,8 @@ export class HaLabelPicker extends SubscribeMixin(LitElement) {
|
|||
|
||||
const filteredItems = fuzzyFilterSort<ScorableLabelItem>(
|
||||
filterString,
|
||||
target.items?.filter((item) =>
|
||||
[NO_LABELS_ID, ADD_NEW_ID].includes(item.ignoreFilter)
|
||||
target.items?.filter(
|
||||
(item) => ![NO_LABELS_ID, ADD_NEW_ID].includes(item.label_id)
|
||||
) || []
|
||||
);
|
||||
if (filteredItems.length === 0) {
|
||||
|
|
|
@ -179,7 +179,9 @@ export class HaCategoryPicker extends SubscribeMixin(LitElement) {
|
|||
|
||||
const filteredItems = fuzzyFilterSort<ScorableCategoryRegistryEntry>(
|
||||
filterString,
|
||||
target.items || []
|
||||
target.items?.filter(
|
||||
(item) => ![NO_CATEGORIES_ID, ADD_NEW_ID].includes(item.category_id)
|
||||
) || []
|
||||
);
|
||||
if (filteredItems?.length === 0) {
|
||||
if (this.noAdd) {
|
||||
|
|
Loading…
Reference in New Issue