@@ -191,14 +191,14 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
191191 table,
192192 } ;
193193
194- const divRef = useRef < any > ( null ) ;
195- const [ isOverflowing , setIsOverflowing ] = useState ( false ) ;
194+ const cellHoverRevealDivRef = useRef < any > ( null ) ;
195+ const [ isCellContentOverflowing , setIsCellContentOverflowing ] = useState ( false ) ;
196196
197197 useLayoutEffect ( ( ) => {
198- const div = divRef . current ;
198+ const div = cellHoverRevealDivRef . current ;
199199 if ( div ) {
200200 const isOverflow = div . scrollWidth > div . clientWidth ;
201- setIsOverflowing ( isOverflow ) ;
201+ setIsCellContentOverflowing ( isOverflow ) ;
202202 }
203203 } , [ tableCellProps . children ] ) ;
204204
@@ -302,14 +302,15 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
302302 } ) }
303303 >
304304 < >
305- { tableCellProps . children ??
306- ( columnDef . enableCellHoverReveal ? (
307- < div ref = { divRef }
308- className = {
309- clsx (
305+ { tableCellProps . children ?? (
306+ columnDef . enableCellHoverReveal ? (
307+ < div
308+ ref = { cellHoverRevealDivRef }
309+ className = { clsx (
310310 columnDef . enableCellHoverReveal && classes [ "cell-hover-reveal" ] ,
311- isOverflowing && classes [ 'overflowing' ]
312- ) } >
311+ isCellContentOverflowing && classes [ 'overflowing' ]
312+ ) }
313+ >
313314 { renderCellContent ( ) }
314315 { cell . getIsGrouped ( ) && ! columnDef . GroupedCell && (
315316 < > ({ row . subRows ?. length } )</ >
@@ -322,7 +323,8 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
322323 < > ({ row . subRows ?. length } )</ >
323324 ) }
324325 </ >
325- ) ) }
326+ )
327+ ) }
326328 </ >
327329 </ TableTd >
328330 ) ;
0 commit comments