Skip to content

Commit 3c278e0

Browse files
authored
fix: Table columns minWidth props no work when virtualized (for 5.x)
1 parent 5246767 commit 3c278e0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/VirtualTable/BodyGrid.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ const Grid = React.forwardRef<GridRef, GridProps>((props, ref) => {
5757
// ========================== Column ==========================
5858
const columnsWidth = React.useMemo<[key: React.Key, width: number, total: number][]>(() => {
5959
let total = 0;
60-
return flattenColumns.map(({ width, key }) => {
61-
total += width as number;
62-
return [key, width as number, total];
60+
return flattenColumns.map(({ width, minWidth, key }) => {
61+
const finalWidth = Math.max((width as number) || 0, (minWidth as number) || 0);
62+
total += finalWidth;
63+
return [key, finalWidth, total];
6364
});
6465
}, [flattenColumns]);
6566

0 commit comments

Comments
 (0)