Skip to content

Commit

Permalink
fix(#1294203): [ReadOnlyTable] Warning '<tr> cannot appear as a child…
Browse files Browse the repository at this point in the history
… of a <div>'
  • Loading branch information
matthias-goupil committed Jun 27, 2024
1 parent a63e496 commit c694126
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export const StyledTable = styled('table')(({ theme }) => ({

'.subRows > td': {
borderBottom: 'none',

table: {
display: 'block',
width: '100%',
borderCollapse: 'collapse',
border: 'none',
},
},

'.subRow': {
Expand Down Expand Up @@ -151,11 +158,15 @@ export function ReadOnlyTableRow({
<tr className="subRows">
<td style={{ padding: 0 }} colSpan={row.cells.length + 1}>
<Collapse in={open} timeout="auto" unmountOnExit>
{row.subRows?.map(
(subRow): JSX.Element => (
<ReadOnlyTableRow key={subRow?.id} row={subRow} subRow />
)
)}
<table>
<tbody>
{row.subRows?.map(
(subRow): JSX.Element => (
<ReadOnlyTableRow key={subRow?.id} row={subRow} subRow />
)
)}
</tbody>
</table>
</Collapse>
</td>
</tr>
Expand Down

0 comments on commit c694126

Please sign in to comment.