diff --git a/src/FixedHolder/index.tsx b/src/FixedHolder/index.tsx index 925206e1e..e5d0f0075 100644 --- a/src/FixedHolder/index.tsx +++ b/src/FixedHolder/index.tsx @@ -40,6 +40,7 @@ export interface FixedHeaderProps extends HeaderProps { tableLayout?: TableLayout; onScroll: (info: { currentTarget: HTMLDivElement; scrollLeft?: number }) => void; children: (info: HeaderProps) => React.ReactNode; + colGroup?: React.ReactNode; } const FixedHolder = React.forwardRef>((props, ref) => { @@ -54,6 +55,7 @@ const FixedHolder = React.forwardRef>((pro columns, flattenColumns, colWidths, + colGroup, columCount, stickyOffsets, direction, @@ -185,7 +187,9 @@ const FixedHolder = React.forwardRef>((pro width: scrollX, }} > - {isColGroupEmpty ? null : ( + {isColGroupEmpty ? ( + colGroup + ) : ( ( stickyTopOffset={offsetHeader} className={`${prefixCls}-header`} ref={scrollHeaderRef} + colGroup={bodyColGroup} > {renderFixedHeaderTable} @@ -756,6 +757,7 @@ const Table = ( stickyBottomOffset={offsetSummary} className={`${prefixCls}-summary`} ref={scrollSummaryRef} + colGroup={bodyColGroup} > {renderFixedFooterTable} diff --git a/tests/__snapshots__/FixedColumn.spec.tsx.snap b/tests/__snapshots__/FixedColumn.spec.tsx.snap index 168e0fa28..18d01d2b0 100644 --- a/tests/__snapshots__/FixedColumn.spec.tsx.snap +++ b/tests/__snapshots__/FixedColumn.spec.tsx.snap @@ -2696,6 +2696,26 @@ exports[`Table.FixedColumn > renders correctly > scrollXY - without data 1`] = ` + + + + + + + + + + + + + +