From b3f00c76477648cd76c98dbf673f5d28129ab90d Mon Sep 17 00:00:00 2001 From: cretadn22 Date: Thu, 22 Aug 2024 01:05:47 +0700 Subject: [PATCH] adjust all selected --- .../workspace/reportFields/ReportFieldsListValuesPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/reportFields/ReportFieldsListValuesPage.tsx b/src/pages/workspace/reportFields/ReportFieldsListValuesPage.tsx index 61967a729cd3..95c06b2331e9 100644 --- a/src/pages/workspace/reportFields/ReportFieldsListValuesPage.tsx +++ b/src/pages/workspace/reportFields/ReportFieldsListValuesPage.tsx @@ -116,9 +116,9 @@ function ReportFieldsListValuesPage({ }; const toggleAllValues = () => { - const isAllSelected = listValues.length === Object.keys(selectedValues).length; + const areAllSelected = listValues.length === selectedValuesArray.length; - setSelectedValues(isAllSelected ? {} : Object.fromEntries(listValues.map((value) => [value, true]))); + setSelectedValues(areAllSelected ? {} : Object.fromEntries(listValues.map((value) => [value, true]))); }; const handleDeleteValues = () => { @@ -176,7 +176,7 @@ function ReportFieldsListValuesPage({ const getHeaderButtons = () => { const options: Array>> = []; - if ((isSmallScreenWidth ? selectionMode?.isEnabled : true) && selectedValuesArray.length > 0) { + if (isSmallScreenWidth ? selectionMode?.isEnabled : selectedValuesArray.length > 0) { if (selectedValuesArray.length > 0) { options.push({ icon: Expensicons.Trashcan,