Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KevinVandy/mantine-react-table
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ac343899b78c975287bde1a08dd0c41f9dd5d425
Choose a base ref
..
head repository: KevinVandy/mantine-react-table
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c9855bce9dd39314511c663ef897132e438b2d15
Choose a head ref
Showing with 5 additions and 5 deletions.
  1. +5 −5 packages/mantine-react-table/src/components/body/MRT_TableBodyCell.tsx
Original file line number Diff line number Diff line change
@@ -192,16 +192,15 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
};

const cellHoverRevealDivRef = useRef<any>(null);
const [isCellContentOverflowing, setIsCellContentOverflowing] =
useState(false);
const [isCellContentOverflowing, setIsCellContentOverflowing] = useState(false);

useLayoutEffect(() => {
const div = cellHoverRevealDivRef.current;
if (div) {
const isOverflow = div.scrollWidth > div.clientWidth;
setIsCellContentOverflowing(isOverflow);
}
}, [cell]);
}, [tableCellProps.children]);

const renderCellContent = () => {
if (cell.getIsPlaceholder()) {
@@ -242,6 +241,7 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({

return <MRT_TableBodyCellValue {...cellValueProps} />;
};

return (
<TableTd
data-column-pinned={isColumnPinned || undefined}
@@ -288,7 +288,6 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
isEditable &&
['cell', 'table'].includes(editDisplayMode ?? '') &&
columnDefType !== 'display' &&
!isCellContentOverflowing &&
classes['root-editable-hover'],
columnDefType === 'data' && classes['root-data-col'],
density === 'xs' && classes['root-nowrap'],
@@ -326,7 +325,8 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
<> ({row.subRows?.length})</>
)}
</>
))}
)
)}
</>
</TableTd>
);