File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed
Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -88,29 +88,20 @@ export function useColumnWidths<R, SR>(
8888
8989 function handleColumnResize ( column : CalculatedColumn < R , SR > , nextWidth : ResizedWidth ) {
9090 const { key : resizingKey } = column ;
91- const columnsToMeasure : string [ ] = [ ] ;
92-
93- // remeasure all columns that can flex and are not resized by the user
94- for ( const { key, width } of viewportColumns ) {
95- if (
96- columnsCanFlex &&
97- resizingKey !== key &&
98- typeof width === 'string' &&
99- ! resizedColumnWidths . has ( key )
100- ) {
101- columnsToMeasure . push ( key ) ;
102- }
103- }
10491
105- if ( columnsToMeasure . length > 0 ) {
106- setMeasuredColumnWidths ( ( measuredColumnWidths ) => {
92+ setMeasuredColumnWidths ( ( measuredColumnWidths ) => {
93+ if ( columnsCanFlex ) {
10794 const newMeasuredColumnWidths = new Map ( measuredColumnWidths ) ;
108- for ( const columnKey of columnsToMeasure ) {
109- newMeasuredColumnWidths . delete ( columnKey ) ;
95+ for ( const { key, width } of viewportColumns ) {
96+ if ( resizingKey !== key && typeof width === 'string' && ! resizedColumnWidths . has ( key ) ) {
97+ newMeasuredColumnWidths . delete ( key ) ;
98+ }
11099 }
111100 return newMeasuredColumnWidths ;
112- } ) ;
113- }
101+ }
102+
103+ return measuredColumnWidths ;
104+ } ) ;
114105
115106 setColumnToAutoResize ( {
116107 key : resizingKey ,
You can’t perform that action at this time.
0 commit comments