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')
)}
Comment on lines +25 to +31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic feels odd to me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brian-smith-tcril sorry for delay!

The pgn__data-table-cell-wrap class (which applies overflow: hidden) was moved from the <td> itself to a new inner <div>, so the cell no longer clips overlay content like dropdowns.

The action column skips this wrapper entirely since it renders interactive controls that need to overflow the cell boundary.

</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();
});
});