Skip to content

Commit 29acb17

Browse files
committed
feat(BulkSelect): disable Select none when no rows are selected
1 parent a46b56b commit 29acb17

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

packages/module/src/BulkSelect/BulkSelect.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ export const BulkSelect: FC<BulkSelectProps> = ({
8888
const splitButtonDropdownItems = useMemo(
8989
() => (
9090
<>
91-
<DropdownItem ouiaId={`${ouiaId}-select-none`} value={BulkSelectValue.none} key={BulkSelectValue.none}>
91+
<DropdownItem
92+
ouiaId={`${ouiaId}-select-none`}
93+
value={BulkSelectValue.none}
94+
key={BulkSelectValue.none}
95+
isDisabled={selectedCount === 0}
96+
>
9297
{selectNoneLabel}
9398
</DropdownItem>
9499
{isDataPaginated && (
@@ -103,7 +108,7 @@ export const BulkSelect: FC<BulkSelectProps> = ({
103108
)}
104109
</>
105110
),
106-
[ isDataPaginated, canSelectAll, ouiaId, selectNoneLabel, selectPageLabel, selectAllLabel, pageCount, totalCount ]
111+
[ isDataPaginated, canSelectAll, ouiaId, selectNoneLabel, selectPageLabel, selectAllLabel, pageCount, totalCount, selectedCount ]
107112
);
108113

109114
const selectedLabelText = selectedLabel(selectedCount);

0 commit comments

Comments
 (0)