@@ -131,9 +131,10 @@ const TableWrapper = styled.div<{
131
131
$rowStyle : TableRowStyleType ;
132
132
toolbarPosition : "above" | "below" | "close" ;
133
133
fixedHeader : boolean ;
134
+ fixedToolbar : boolean ;
134
135
} > `
135
136
max-height: 100%;
136
- overflow-y: ${ ( props ) => ( props . fixedHeader ? "hidden" : " auto" ) } ;
137
+ overflow-y: auto;
137
138
background: white;
138
139
border: ${ ( props ) => `1px solid ${ props . $style . border } ` } ;
139
140
border-radius: ${ ( props ) => props . $style . radius } ;
@@ -168,6 +169,10 @@ const TableWrapper = styled.div<{
168
169
border-top: none !important;
169
170
border-inline-start: none !important;
170
171
172
+ .ant-table-content {
173
+ overflow: unset !important;
174
+ }
175
+
171
176
// A table expand row contains table
172
177
.ant-table-tbody .ant-table-wrapper:only-child .ant-table {
173
178
margin: 0;
@@ -182,7 +187,15 @@ const TableWrapper = styled.div<{
182
187
border-color: ${ ( props ) => props . $style . border } ;
183
188
color: ${ ( props ) => props . $style . headerText } ;
184
189
border-inline-end: ${ ( props ) => `1px solid ${ props . $style . border } ` } !important;
185
-
190
+ ${ ( props ) =>
191
+ props . fixedHeader && `
192
+ position: sticky;
193
+ position: -webkit-sticky;
194
+ top: ${ props . fixedToolbar ? '47px' : '0' } ;
195
+ z-index: 99;
196
+ `
197
+ }
198
+
186
199
&:last-child {
187
200
border-inline-end: none !important;
188
201
}
@@ -371,9 +384,6 @@ type CustomTableProps<RecordType> = Omit<TableProps<RecordType>, "components" |
371
384
viewModeResizable : boolean ;
372
385
rowColorFn : RowColorViewType ;
373
386
columnsStyle : TableColumnStyleType ;
374
- fixedHeader : boolean ;
375
- height ?: number ;
376
- autoHeight ?: boolean ;
377
387
} ;
378
388
379
389
function TableCellView ( props : {
@@ -547,9 +557,7 @@ function ResizeableTable<RecordType extends object>(props: CustomTableProps<Reco
547
557
columns = { columns }
548
558
scroll = { {
549
559
x : COL_MIN_WIDTH * columns . length ,
550
- y : props . fixedHeader && props . height && ! props . autoHeight
551
- ? `${ props . height - 100 } px`
552
- : undefined ,
560
+ y : undefined ,
553
561
} }
554
562
> </ Table >
555
563
) ;
@@ -563,10 +571,10 @@ export function TableCompView(props: {
563
571
onDownload : ( fileName : string ) => void ;
564
572
} ) {
565
573
const editorState = useContext ( EditorContext ) ;
566
- const { width, height , ref } = useResizeDetector ( {
574
+ const { width, ref } = useResizeDetector ( {
567
575
refreshMode : "debounce" ,
568
576
refreshRate : 600 ,
569
- handleHeight : true ,
577
+ handleHeight : false ,
570
578
} ) ;
571
579
const viewMode = useUserViewMode ( ) ;
572
580
const compName = useContext ( CompNameContext ) ;
@@ -591,7 +599,6 @@ export function TableCompView(props: {
591
599
( ) => compChildren . dynamicColumnConfig . getView ( ) ,
592
600
[ compChildren . dynamicColumnConfig ]
593
601
) ;
594
- const autoHeight = compChildren . autoHeight . getView ( ) ;
595
602
const columnsAggrData = comp . columnAggrData ;
596
603
const expansion = useMemo ( ( ) => compChildren . expansion . getView ( ) , [ compChildren . expansion ] ) ;
597
604
const antdColumns = useMemo (
@@ -689,6 +696,7 @@ export function TableCompView(props: {
689
696
$rowStyle = { rowStyle }
690
697
toolbarPosition = { toolbar . position }
691
698
fixedHeader = { compChildren . fixedHeader . getView ( ) }
699
+ fixedToolbar = { toolbar . fixedToolbar && toolbar . position === 'above' }
692
700
>
693
701
{ toolbar . position === "above" && toolbarView }
694
702
< ResizeableTable < RecordType >
@@ -709,15 +717,12 @@ export function TableCompView(props: {
709
717
onTableChange ( pagination , filters , sorter , extra , comp . dispatch , onEvent ) ;
710
718
} }
711
719
showHeader = { ! compChildren . hideHeader . getView ( ) }
712
- fixedHeader = { compChildren . fixedHeader . getView ( ) }
713
720
columns = { antdColumns }
714
721
columnsStyle = { columnsStyle }
715
722
viewModeResizable = { compChildren . viewModeResizable . getView ( ) }
716
723
dataSource = { pageDataInfo . data }
717
724
size = { compChildren . size . getView ( ) }
718
725
tableLayout = "fixed"
719
- height = { height }
720
- autoHeight = { autoHeight }
721
726
loading = {
722
727
loading ||
723
728
// fixme isLoading type
0 commit comments