From b35820fe4f204460bd057490795ba2a3771e376b Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Thu, 26 Sep 2024 12:10:12 +0530 Subject: [PATCH] Create a copy of list values before sorting --- src/pages/workspace/reportFields/CreateReportFieldsPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx b/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx index 79be1022da33..8dbd90c9e929 100644 --- a/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx +++ b/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx @@ -92,6 +92,8 @@ function CreateReportFieldsPage({ const [modal] = useOnyx(ONYXKEYS.MODAL); + const listValues = [...(formDraft?.[INPUT_IDS.LIST_VALUES] ?? [])].sort(localeCompare).join(', '); + return ( Navigation.navigate(ROUTES.WORKSPACE_REPORT_FIELDS_LIST_VALUES.getRoute(policyID))} - title={formDraft?.[INPUT_IDS.LIST_VALUES]?.sort(localeCompare)?.join(', ')} + title={listValues} numberOfLinesTitle={5} /> )}