diff --git a/src/FixedHolder/index.tsx b/src/FixedHolder/index.tsx index 48f66b4ae..86e739be1 100644 --- a/src/FixedHolder/index.tsx +++ b/src/FixedHolder/index.tsx @@ -137,6 +137,20 @@ const FixedHolder = React.forwardRef>((pro const mergedColumnWidth = useColumnWidth(colWidths, columCount); + const colGroupNode = useMemo(() => { + // use original ColGroup if no data or no calculated column width, otherwise use calculated column width + if (noData || !mergedColumnWidth) { + return colGroup; + } + return ( + + ); + }, [noData, mergedColumnWidth, colGroup, combinationScrollBarSize, columCount, flattenColumnsWithScrollbar]); + return (
>((pro ...scrollTableStyle, }} > - {/* use original ColGroup if no data, otherwise use calculated column width */} - {noData ? ( - colGroup - ) : ( - - )} + {colGroupNode} {children({ ...restProps, stickyOffsets: headerStickyOffsets,