Skip to content

Commit 15da4f5

Browse files
committed
Cap bodyColumnCount if numCols is larger
Signed-off-by: Itay Dafna <[email protected]>
1 parent 89b3412 commit 15da4f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/datagrid/src/datagrid.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,11 +1536,11 @@ class DataGrid extends Widget {
15361536
} else {
15371537
/*
15381538
Otherwise the entire body column count can be resized.
1539-
Resize all body columns and subtract from remaining
1540-
column resize allowance.
1539+
Resize based on the smallest number between remaining
1540+
resize allowance and body column count.
15411541
*/
1542-
this._fitBodyColumnHeaders(this.dataModel, bodyColumnCount);
1543-
colsRemaining = colsRemaining - bodyColumnCount;
1542+
this._fitBodyColumnHeaders(this.dataModel,
1543+
Math.min(colsRemaining, bodyColumnCount));
15441544
}
15451545
} else {
15461546
// No column resize cap passed - resizing all columns.

0 commit comments

Comments
 (0)