Skip to content

Commit 3095c62

Browse files
fix(18624): unique name for selectall input (#18645)
Co-authored-by: Riddhi Bansal <41935566+riddhybansal@users.noreply.github.com>
1 parent e2d106a commit 3095c62

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/react/src/components/DataTable/DataTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ class DataTable<RowType, ColTypes extends any[]> extends React.Component<
668668
checked,
669669
id: `${this.getTablePrefix()}__select-all`,
670670
indeterminate,
671-
name: 'select-all',
671+
name: `select-all-${this.instanceId}`,
672672
onSelect: composeEventHandlers([this.handleSelectAll, onClick]),
673673
};
674674
};

packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ exports[`DataTable behaves as expected selection should render and match snapsho
654654
<input
655655
class="cds--checkbox"
656656
id="data-table-7__select-all"
657-
name="select-all"
657+
name="select-all-7"
658658
type="checkbox"
659659
/>
660660
<label

0 commit comments

Comments
 (0)