Skip to content

Commit

Permalink
Merge pull request #47808 from cretadn22/adjust-all-selected-button
Browse files Browse the repository at this point in the history
Adjust all selected button
  • Loading branch information
puneetlath committed Aug 26, 2024
2 parents 49680df + b3f00c7 commit c601cbc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -176,7 +176,7 @@ function ReportFieldsListValuesPage({

const getHeaderButtons = () => {
const options: Array<DropdownOption<DeepValueOf<typeof CONST.POLICY.BULK_ACTION_TYPES>>> = [];
if ((isSmallScreenWidth ? selectionMode?.isEnabled : true) && selectedValuesArray.length > 0) {
if (isSmallScreenWidth ? selectionMode?.isEnabled : selectedValuesArray.length > 0) {
if (selectedValuesArray.length > 0) {
options.push({
icon: Expensicons.Trashcan,
Expand Down

0 comments on commit c601cbc

Please sign in to comment.