Skip to content

Commit

Permalink
fix(DataTable): do not show selectAll header with radio selection (#1…
Browse files Browse the repository at this point in the history
…3920)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
francinelucca and kodiakhq[bot] authored Jun 6, 2023
1 parent 7469c25 commit a1b12bd
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ export const Playground = (args) => (
<Table {...getTableProps()}>
<TableHead>
<TableRow>
<TableSelectAll {...getSelectionProps()} />
{args.radio ? (
<th scope="col" />
) : (
<TableSelectAll {...getSelectionProps()} />
)}
{headers.map((header, i) => (
<TableHeader key={i} {...getHeaderProps({ header })}>
{header.header}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ Playground.argTypes = {
disable: true,
},
},
radio: {
table: {
disable: true,
},
},
sortRow: {
table: {
disable: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ export const Playground = (args) => (
<Table {...getTableProps()}>
<TableHead>
<TableRow>
<TableSelectAll {...getSelectionProps()} />
{args.radio ? (
<th scope="col" />
) : (
<TableSelectAll {...getSelectionProps()} />
)}
{headers.map((header, i) => (
<TableHeader key={i} {...getHeaderProps({ header })}>
{header.header}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ Playground.argTypes = {
disable: true,
},
},
radio: {
table: {
disable: true,
},
},
rows: {
table: {
disable: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,10 @@ Playground.argTypes = {
useZebraStyles: {
control: { type: 'boolean' },
},
radio: {
control: { type: 'boolean' },
},
isSortable: { control: { type: 'boolean' } },
persistent: { control: { type: 'boolean' } },
overflowMenuOnHover: {
control: { type: 'boolean' },
},
radio: { table: { disable: true } },
};
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,11 @@ export const Playground = (args) => {
<TableHead>
<TableRow>
<TableExpandHeader />
<TableSelectAll {...getSelectionProps()} />
{args.radio ? (
<th scope="col" />
) : (
<TableSelectAll {...getSelectionProps()} />
)}
{headers.map((header, i) => (
<TableHeader key={i} {...getHeaderProps({ header })}>
{header.header}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,11 @@ export const Playground = (args) => (
)}
</DataTable>
);

Playground.argTypes = {
radio: {
table: {
disable: true,
},
},
};

0 comments on commit a1b12bd

Please sign in to comment.