Skip to content

Commit

Permalink
Merge pull request Expensify#35922 from tienifr/fix/35553
Browse files Browse the repository at this point in the history
Fix: Cannot deselect disabled category
  • Loading branch information
Julesssss authored Feb 16, 2024
2 parents 91cb6e0 + 24d67d1 commit bea6aaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ function getCategoryListSections(
}

const selectedOptionNames = selectedOptions.map((selectedOption) => selectedOption.name);
const enabledAndSelectedCategories = sortedCategories.filter((category) => category.enabled || selectedOptionNames.includes(category.name));
const enabledAndSelectedCategories = [...selectedOptions, ...sortedCategories.filter((category) => category.enabled && !selectedOptionNames.includes(category.name))];
const numberOfVisibleCategories = enabledAndSelectedCategories.length;

if (numberOfVisibleCategories < CONST.CATEGORY_LIST_THRESHOLD) {
Expand Down

0 comments on commit bea6aaf

Please sign in to comment.