Skip to content

Commit

Permalink
Create a copy of list values before sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1206agra committed Sep 26, 2024
1 parent b5c47c5 commit b35820f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/workspace/reportFields/CreateReportFieldsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ function CreateReportFieldsPage({

const [modal] = useOnyx(ONYXKEYS.MODAL);

const listValues = [...(formDraft?.[INPUT_IDS.LIST_VALUES] ?? [])].sort(localeCompare).join(', ');

return (
<AccessOrNotFoundWrapper
accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
Expand Down Expand Up @@ -148,7 +150,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]?.sort(localeCompare)?.join(', ')}
title={listValues}
numberOfLinesTitle={5}
/>
)}
Expand Down

0 comments on commit b35820f

Please sign in to comment.