@@ -27,6 +27,7 @@ function useColumnWidth(colWidths: readonly number[], columCount: number) {
27
27
export interface FixedHeaderProps < RecordType > extends HeaderProps < RecordType > {
28
28
className : string ;
29
29
noData : boolean ;
30
+ maxContentScroll : boolean ;
30
31
colWidths : readonly number [ ] ;
31
32
columCount : number ;
32
33
direction : Direction ;
@@ -57,6 +58,7 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
57
58
stickyBottomOffset,
58
59
stickyClassName,
59
60
onScroll,
61
+ maxContentScroll,
60
62
children,
61
63
...restProps
62
64
} = props ;
@@ -96,6 +98,12 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
96
98
} ;
97
99
} , [ ] ) ;
98
100
101
+ // Check if all flattenColumns has width
102
+ const allFlattenColumnsWithWidth = React . useMemo (
103
+ ( ) => flattenColumns . every ( column => column . width ) ,
104
+ [ flattenColumns ] ,
105
+ ) ;
106
+
99
107
// Add scrollbar column
100
108
const lastColumn = flattenColumns [ flattenColumns . length - 1 ] ;
101
109
const ScrollBarColumn : ColumnType < unknown > & { scrollbar : true } = {
@@ -148,11 +156,13 @@ const FixedHolder = React.forwardRef<HTMLDivElement, FixedHeaderProps<any>>((pro
148
156
visibility : noData || mergedColumnWidth ? null : 'hidden' ,
149
157
} }
150
158
>
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
+ ) }
156
166
{ children ( {
157
167
...restProps ,
158
168
stickyOffsets : headerStickyOffsets ,
0 commit comments