From ab073b6c297d383da4d179ac75fd4626b80b30c9 Mon Sep 17 00:00:00 2001 From: LeiZhang <50943004+cactuser-Lu@users.noreply.github.com> Date: Thu, 4 Sep 2025 09:44:46 +0800 Subject: [PATCH] fix: Table columns minWidth props no work when virtualized (#1334) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 路振凯 --- src/VirtualTable/BodyGrid.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/VirtualTable/BodyGrid.tsx b/src/VirtualTable/BodyGrid.tsx index e3aa85f49..4ea09dc58 100644 --- a/src/VirtualTable/BodyGrid.tsx +++ b/src/VirtualTable/BodyGrid.tsx @@ -57,9 +57,10 @@ const Grid = React.forwardRef((props, ref) => { // ========================== Column ========================== const columnsWidth = React.useMemo<[key: React.Key, width: number, total: number][]>(() => { let total = 0; - return flattenColumns.map(({ width, key }) => { - total += width as number; - return [key, width as number, total]; + return flattenColumns.map(({ width, minWidth, key }) => { + const finalWidth = Math.max((width as number) || 0, (minWidth as number) || 0); + total += finalWidth; + return [key, finalWidth, total]; }); }, [flattenColumns]);