diff --git a/src/DataTable/README.md b/src/DataTable/README.md index fc40cac0dd..8f256b90a2 100644 --- a/src/DataTable/README.md +++ b/src/DataTable/README.md @@ -1689,4 +1689,4 @@ After selecting the maximum possible number of rows, you can display an error me ); } -``` +``` \ No newline at end of file diff --git a/src/DataTable/TableCell.tsx b/src/DataTable/TableCell.tsx index 7498578545..f2b6bd9902 100644 --- a/src/DataTable/TableCell.tsx +++ b/src/DataTable/TableCell.tsx @@ -10,13 +10,25 @@ interface TableCellProps { column: { /** Class(es) to be applied to the cells in the given column */ cellClassName?: string; + /** Uniq ID of the column */ + id?: string; }; } function TableCell({ getCellProps, render, column }: TableCellProps) { const { className, ...rest } = getCellProps(); + + const isActionColumn = column.id === 'action'; + const cellClasses = classNames(className, column.cellClassName); + return ( - - {render('Cell')} + + {!isActionColumn ? ( +
+ {render('Cell')} +
+ ) : ( + render('Cell') + )} ); } diff --git a/src/DataTable/tests/TableRow.test.jsx b/src/DataTable/tests/TableRow.test.jsx index 17a46e7c03..3989d95695 100644 --- a/src/DataTable/tests/TableRow.test.jsx +++ b/src/DataTable/tests/TableRow.test.jsx @@ -82,9 +82,8 @@ describe('', () => { }); it('does not render subcomponent if row is in expanded state and does not have renderRowSubComponent function defined', () => { - const { container } = render(); + render(); const rows = screen.getAllByRole('row'); expect(rows.length).toEqual(1); - expect(container.querySelector('div')).not.toBeInTheDocument(); }); });