From 06a303872312c931f52b6ea1a455d7581407f833 Mon Sep 17 00:00:00 2001 From: cretadn22 Date: Tue, 6 Aug 2024 11:16:18 +0700 Subject: [PATCH] add sort func --- src/pages/EditReportFieldDropdown.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/EditReportFieldDropdown.tsx b/src/pages/EditReportFieldDropdown.tsx index 579d8e6c53ca..d37b6af09c4f 100644 --- a/src/pages/EditReportFieldDropdown.tsx +++ b/src/pages/EditReportFieldDropdown.tsx @@ -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'; @@ -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( [],