From 6d0edabdbb6873189ad8477ded77661e31e87c5b Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 5 Jul 2024 11:46:01 +0700 Subject: [PATCH] Fix select all checkbox is not checked when all items are checked --- src/components/SelectionList/BaseSelectionList.tsx | 2 +- src/libs/SearchUtils.ts | 1 + 2 files changed, 2 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 7dd8c89a398d..cb579e44b95d 100644 --- a/src/libs/SearchUtils.ts +++ b/src/libs/SearchUtils.ts @@ -167,6 +167,7 @@ function getReportSections(data: OnyxTypes.SearchResults['data'], metadata: Onyx reportIDToTransactions[reportKey] = { ...value, + keyForList: value.reportID, from: data.personalDetailsList?.[value.accountID], to: data.personalDetailsList?.[value.managerID], transactions,