Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DataTable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1689,4 +1689,4 @@ After selecting the maximum possible number of rows, you can display an error me
</DataTable>
);
}
```
```
16 changes: 14 additions & 2 deletions src/DataTable/TableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<td {...rest} className={classNames('pgn__data-table-cell-wrap', className, column.cellClassName)}>
{render('Cell')}
<td {...rest} className={cellClasses}>
{!isActionColumn ? (
<div className="pgn__data-table-cell-wrap">
{render('Cell')}
</div>
) : (
render('Cell')
)}
</td>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/DataTable/tests/TableRow.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ describe('<TableRow />', () => {
const { container } = render(<TableRowWrapper value={{}} row={{ ...props, isExpanded: true }} />);
const rows = screen.getAllByRole('row');
expect(rows.length).toEqual(1);
expect(container.querySelector('div')).not.toBeInTheDocument();
expect(container.querySelector('div')).toBeInTheDocument();
});
});