diff --git a/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx b/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx index 5b7aef04f928..e9863074274a 100644 --- a/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx +++ b/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx @@ -13,6 +13,7 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ReportField from '@libs/actions/Policy/ReportField'; import DateUtils from '@libs/DateUtils'; +import localeCompare from '@libs/LocaleCompare'; import Navigation from '@libs/Navigation/Navigation'; import * as PolicyUtils from '@libs/PolicyUtils'; import type {SettingsNavigatorParamList} from '@navigation/types'; @@ -151,7 +152,7 @@ function CreateReportFieldsPage({ description={translate('workspace.reportFields.listValues')} shouldShowRightIcon onPress={() => Navigation.navigate(ROUTES.WORKSPACE_REPORT_FIELDS_LIST_VALUES.getRoute(policyID))} - title={formDraft?.[INPUT_IDS.LIST_VALUES]?.join(', ')} + title={formDraft?.[INPUT_IDS.LIST_VALUES]?.sort(localeCompare)?.join(', ')} numberOfLinesTitle={5} /> )} diff --git a/src/pages/workspace/reportFields/ReportFieldsSettingsPage.tsx b/src/pages/workspace/reportFields/ReportFieldsSettingsPage.tsx index f481992208e9..cc6460d20641 100644 --- a/src/pages/workspace/reportFields/ReportFieldsSettingsPage.tsx +++ b/src/pages/workspace/reportFields/ReportFieldsSettingsPage.tsx @@ -10,6 +10,7 @@ import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import ScreenWrapper from '@components/ScreenWrapper'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import localeCompare from '@libs/LocaleCompare'; import Navigation from '@libs/Navigation/Navigation'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportUtils from '@libs/ReportUtils'; @@ -47,7 +48,7 @@ function ReportFieldsSettingsPage({ const isDateFieldType = reportField.type === CONST.REPORT_FIELD_TYPES.DATE; const isListFieldType = reportField.type === CONST.REPORT_FIELD_TYPES.LIST; const isListFieldEmpty = isListFieldType && reportField.disabledOptions.filter((disabledListValue) => !disabledListValue).length <= 0; - const listValues = Object.values(policy?.fieldList?.[reportFieldKey]?.values ?? {}); + const listValues = Object.values(policy?.fieldList?.[reportFieldKey]?.values ?? {})?.sort(localeCompare); const deleteReportFieldAndHideModal = () => { ReportField.deleteReportFields(policyID, [reportFieldKey]);