Skip to content

Commit

Permalink
Sorting multi-select fields in the advanced search filter page
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony-MK authored Sep 9, 2024
1 parent 9affb13 commit eb7d625
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/Search/AdvancedSearchFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import useSingleExecution from '@hooks/useSingleExecution';
import useThemeStyles from '@hooks/useThemeStyles';
import useWaitForNavigation from '@hooks/useWaitForNavigation';
import {convertToDisplayStringWithoutCurrency} from '@libs/CurrencyUtils';
import localeCompare from '@libs/LocaleCompare';
import Navigation from '@libs/Navigation/Navigation';
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils';
import {getAllTaxRates} from '@libs/PolicyUtils';
Expand Down Expand Up @@ -182,7 +183,7 @@ function getFilterDisplayTitle(filters: Partial<SearchAdvancedFiltersForm>, fiel
filters[fieldName]
) {
const filterArray = filters[fieldName] ?? [];
return filterArray.join(', ');
return filterArray.sort(localeCompare).join(', ');
}

if (fieldName === CONST.SEARCH.SYNTAX_FILTER_KEYS.DESCRIPTION) {
Expand Down

0 comments on commit eb7d625

Please sign in to comment.