Skip to content

Commit

Permalink
Merge pull request #49772 from shubham1206agra/fix-49546
Browse files Browse the repository at this point in the history
Create a copy of list values before sorting
  • Loading branch information
johnmlee101 authored Sep 30, 2024
2 parents 6a2b44a + b35820f commit e84dab7
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 e84dab7

Please sign in to comment.