Skip to content

Commit

Permalink
Merge pull request #37479 from dukenv0307/fix/37287
Browse files Browse the repository at this point in the history
fix: Selected category is not ticked when it appears in the search result
  • Loading branch information
puneetlath authored Mar 12, 2024
2 parents 73b8ec4 + 66f081b commit ffb9933
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,17 @@ function getCategoryListSections(
}

if (searchInputValue) {
const searchCategories = enabledCategories.filter((category) => category.name.toLowerCase().includes(searchInputValue.toLowerCase()));
const searchCategories: Category[] = [];

enabledCategories.forEach((category) => {
if (!category.name.toLowerCase().includes(searchInputValue.toLowerCase())) {
return;
}
searchCategories.push({
...category,
isSelected: selectedOptions.some((selectedOption) => selectedOption.name === category.name),
});
});

categorySections.push({
// "Search" section
Expand Down

0 comments on commit ffb9933

Please sign in to comment.