@@ -27,6 +27,7 @@ function useColumnWidth(colWidths: readonly number[], columCount: number) {
2727export interface FixedHeaderProps < RecordType > extends HeaderProps < RecordType > {
2828 className : string ;
2929 noData : boolean ;
30+ maxContentScroll : boolean ;
3031 colWidths : readonly number [ ] ;
3132 columCount : number ;
3233 direction : Direction ;
@@ -57,6 +58,7 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
5758 stickyBottomOffset,
5859 stickyClassName,
5960 onScroll,
61+ maxContentScroll,
6062 children,
6163 ...restProps
6264 } = props ;
@@ -96,6 +98,12 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
9698 } ;
9799 } , [ ] ) ;
98100
101+ // Check if all flattenColumns has width
102+ const allFlattenColumnsWithWidth = React . useMemo (
103+ ( ) => flattenColumns . every ( column => column . width ) ,
104+ [ flattenColumns ] ,
105+ ) ;
106+
99107 // Add scrollbar column
100108 const lastColumn = flattenColumns [ flattenColumns . length - 1 ] ;
101109 const ScrollBarColumn : ColumnType < unknown > & { scrollbar : true } = {
@@ -148,11 +156,13 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
148156 visibility : noData || mergedColumnWidth ? null : 'hidden' ,
149157 } }
150158 >
151- < ColGroup
152- colWidths = { mergedColumnWidth ? [ ...mergedColumnWidth , combinationScrollBarSize ] : [ ] }
153- columCount = { columCount + 1 }
154- columns = { flattenColumnsWithScrollbar }
155- />
159+ { ( ! noData || ! maxContentScroll || allFlattenColumnsWithWidth ) && (
160+ < ColGroup
161+ colWidths = { mergedColumnWidth ? [ ...mergedColumnWidth , combinationScrollBarSize ] : [ ] }
162+ columCount = { columCount + 1 }
163+ columns = { flattenColumnsWithScrollbar }
164+ />
165+ ) }
156166 { children ( {
157167 ...restProps ,
158168 stickyOffsets : headerStickyOffsets ,
0 commit comments