Skip to content

Commit

Permalink
fix(react): fix ally issue in datatable in storybook (#11217)
Browse files Browse the repository at this point in the history
* fix(react): fix ally issue in datatable in storybook

* chore(react): fix missing ids and missing expandHeader

Co-authored-by: Alessandra Davila <adavila91@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 25, 2022
1 parent 6b359e6 commit 52e4888
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const Usage = (args) => (
<Table {...getTableProps()}>
<TableHead>
<TableRow>
<TableExpandHeader />
<TableExpandHeader id="expand" />
{headers.map((header, i) => (
<TableHeader key={i} {...getHeaderProps({ header })}>
{header.header}
Expand All @@ -89,7 +89,7 @@ export const Usage = (args) => (
<TableBody>
{rows.map((row) => (
<React.Fragment key={row.id}>
<TableExpandRow {...getRowProps({ row })}>
<TableExpandRow expandHeader="expand" {...getRowProps({ row })}>
{row.cells.map((cell) => (
<TableCell key={cell.id}>{cell.value}</TableCell>
))}
Expand Down Expand Up @@ -131,6 +131,7 @@ export const BatchExpansion = (args) => (
<TableHead>
<TableRow>
<TableExpandHeader
id="expand"
enableExpando={true}
{...getExpandHeaderProps()}
/>
Expand All @@ -144,7 +145,7 @@ export const BatchExpansion = (args) => (
<TableBody>
{rows.map((row) => (
<React.Fragment key={row.id}>
<TableExpandRow {...getRowProps({ row })}>
<TableExpandRow expandHeader="expand" {...getRowProps({ row })}>
{row.cells.map((cell) => (
<TableCell key={cell.id}>{cell.value}</TableCell>
))}
Expand Down

0 comments on commit 52e4888

Please sign in to comment.