Skip to content

Commit

Permalink
Fix search for labels and categories (#20262)
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya authored Mar 29, 2024
1 parent 1300cff commit 510e010
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/ha-label-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion src/panels/config/category/ha-category-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 510e010

Please sign in to comment.