Skip to content

Commit

Permalink
fix(data-table): add single selection row for multiple tables support (
Browse files Browse the repository at this point in the history
…carbon-design-system#17191)

Co-authored-by: Nikhil Tomar <[email protected]>
  • Loading branch information
yaoterry and 2nikhiltom authored Aug 21, 2024
1 parent 7ea912b commit 6eb536d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/components/DataTable/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ class DataTable<RowType, ColTypes extends any[]> extends React.Component<
onClick,
]),
id: `${this.getTablePrefix()}__select-row-${row.id}`,
name: `select-row`,
name: `select-row-${this.instanceId}`,
ariaLabel: t(translationKey), // TODO remove in v12
'aria-label': t(translationKey),
disabled: row.disabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`DataTable behaves as expected selection -- radio buttons should not hav
<input
class="cds--radio-button"
id="data-table-17__select-row-b"
name="select-row"
name="select-row-17"
type="radio"
value=""
/>
Expand Down Expand Up @@ -100,7 +100,7 @@ exports[`DataTable behaves as expected selection -- radio buttons should not hav
<input
class="cds--radio-button"
id="data-table-17__select-row-a"
name="select-row"
name="select-row-17"
type="radio"
value=""
/>
Expand Down Expand Up @@ -138,7 +138,7 @@ exports[`DataTable behaves as expected selection -- radio buttons should not hav
<input
class="cds--radio-button"
id="data-table-17__select-row-c"
name="select-row"
name="select-row-17"
type="radio"
value=""
/>
Expand Down Expand Up @@ -234,7 +234,7 @@ exports[`DataTable behaves as expected selection -- radio buttons should render
<input
class="cds--radio-button"
id="data-table-16__select-row-b"
name="select-row"
name="select-row-16"
type="radio"
value=""
/>
Expand Down Expand Up @@ -272,7 +272,7 @@ exports[`DataTable behaves as expected selection -- radio buttons should render
<input
class="cds--radio-button"
id="data-table-16__select-row-a"
name="select-row"
name="select-row-16"
type="radio"
value=""
/>
Expand Down Expand Up @@ -310,7 +310,7 @@ exports[`DataTable behaves as expected selection -- radio buttons should render
<input
class="cds--radio-button"
id="data-table-16__select-row-c"
name="select-row"
name="select-row-16"
type="radio"
value=""
/>
Expand Down Expand Up @@ -691,7 +691,7 @@ exports[`DataTable behaves as expected selection should render and match snapsho
<input
class="cds--checkbox"
id="data-table-7__select-row-b"
name="select-row"
name="select-row-7"
type="checkbox"
/>
<label
Expand Down Expand Up @@ -724,7 +724,7 @@ exports[`DataTable behaves as expected selection should render and match snapsho
<input
class="cds--checkbox"
id="data-table-7__select-row-a"
name="select-row"
name="select-row-7"
type="checkbox"
/>
<label
Expand Down Expand Up @@ -757,7 +757,7 @@ exports[`DataTable behaves as expected selection should render and match snapsho
<input
class="cds--checkbox"
id="data-table-7__select-row-c"
name="select-row"
name="select-row-7"
type="checkbox"
/>
<label
Expand Down

0 comments on commit 6eb536d

Please sign in to comment.