From 1bf731906c43a615c812a2e6561ccc2ec5a4236b Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:36:18 +0100 Subject: [PATCH] Merge pull request #44882 from nkdengineer/fix/44801 [CP Staging] Fix select all checkbox is not checked when all items are checked (cherry picked from commit 87f5cdd7f19ceb014b26c0e0048593f5ac0eab49) --- src/components/SelectionList/BaseSelectionList.tsx | 2 +- src/libs/SearchUtils.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index 503f7d11d2da..ae70e5525393 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -166,7 +166,7 @@ function BaseSelectionList( itemLayouts.push({length: fullItemHeight, offset}); offset += fullItemHeight; - if (item.isSelected && !selectedOptions.find((option) => option.text === item.text)) { + if (item.isSelected && !selectedOptions.find((option) => option.keyForList === item.keyForList)) { selectedOptions.push(item); } }); diff --git a/src/libs/SearchUtils.ts b/src/libs/SearchUtils.ts index a76e14fe0290..10661945154d 100644 --- a/src/libs/SearchUtils.ts +++ b/src/libs/SearchUtils.ts @@ -167,6 +167,12 @@ function getReportSections(data: OnyxTypes.SearchResults['data'], metadata: Onyx reportIDToTransactions[reportKey] = { ...value, +<<<<<<< HEAD +======= + keyForList: value.reportID, + from: data.personalDetailsList?.[value.accountID], + to: data.personalDetailsList?.[value.managerID], +>>>>>>> 87f5cdd7 (Merge pull request #44882 from nkdengineer/fix/44801) transactions, }; } else if (key.startsWith(ONYXKEYS.COLLECTION.TRANSACTION)) {