@@ -71,11 +71,17 @@ export class TableLayout<T> extends ListLayout<T> {
71
71
this . wasLoading = this . isLoading ;
72
72
this . isLoading = loadingState === 'loading' || loadingState === 'loadingMore' ;
73
73
74
+ // only rebuild columns that come after the column being resized, if no column is being resized, they will all be built
74
75
const resizeIndex = this . collection . columns . findIndex ( column => column . key === this . currentResizeColumn ) ;
75
- let affectedResizeColumns = this . collection . columns . slice ( resizeIndex + 1 , this . collection . columns . length ) ;
76
- let remainingSpace = this . virtualizer . visibleRect . width ;
77
- remainingSpace = this . collection . columns . slice ( 0 , resizeIndex + 1 ) . reduce ( ( acc , column ) => acc - this . getColumnWidth_ ( column . key ) , this . virtualizer . visibleRect . width ) ;
76
+ // if resizing, set the column width for the resized column to the delta bounded by it's min/max
77
+ if ( resizeIndex > - 1 ) {
78
+ const columnProps = this . collection . columns [ resizeIndex ] . props ;
79
+ this . setColumnWidth ( this . currentResizeColumn , Math . max ( this . getMinWidth ( columnProps ?. minWidth ) , Math . min ( this . getMaxWidth ( columnProps . maxWidth ) , this . resizeDelta ) ) ) ;
80
+ }
81
+ const affectedResizeColumns = this . collection . columns . slice ( resizeIndex + 1 , this . collection . columns . length ) ;
82
+ const remainingSpace = this . collection . columns . slice ( 0 , resizeIndex + 1 ) . reduce ( ( acc , column ) => acc - this . getColumnWidth_ ( column . key ) , this . virtualizer . visibleRect . width ) ;
78
83
this . buildColumnWidths ( affectedResizeColumns , remainingSpace ) ;
84
+
79
85
let header = this . buildHeader ( ) ;
80
86
let body = this . buildBody ( 0 ) ;
81
87
body . layoutInfo . rect . width = Math . max ( header . layoutInfo . rect . width , body . layoutInfo . rect . width ) ;
0 commit comments