Skip to content

Commit

Permalink
add sort func
Browse files Browse the repository at this point in the history
  • Loading branch information
cretadn22 committed Aug 6, 2024
1 parent bd4b169 commit 06a3038
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/EditReportFieldDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {ListItem} from '@components/SelectionList/types';
import useDebouncedState from '@hooks/useDebouncedState';
import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import localeCompare from '@libs/LocaleCompare';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -61,7 +62,7 @@ function EditReportFieldDropdownPage({onSubmit, fieldKey, fieldValue, fieldOptio
);

const [sections, headerMessage] = useMemo(() => {
const validFieldOptions = fieldOptions?.filter((option) => !!option);
const validFieldOptions = fieldOptions?.filter((option) => !!option).sort((a, b) => localeCompare(a, b));

const {policyReportFieldOptions} = OptionsListUtils.getFilteredOptions(
[],
Expand Down

0 comments on commit 06a3038

Please sign in to comment.