From 6bbd5c86da6564a4f7dc92454bc35b39f477c5ca Mon Sep 17 00:00:00 2001 From: niayyy Date: Sun, 12 May 2024 21:55:45 +0800 Subject: [PATCH] fix: remove unnessary extraRender calculate --- src/VirtualTable/BodyGrid.tsx | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/VirtualTable/BodyGrid.tsx b/src/VirtualTable/BodyGrid.tsx index dc9d3cd63..c20eedfb6 100644 --- a/src/VirtualTable/BodyGrid.tsx +++ b/src/VirtualTable/BodyGrid.tsx @@ -112,7 +112,7 @@ const Grid = React.forwardRef((props, ref) => { const { start, end, getSize, offsetY } = info; // Do nothing if no data - if (end < 0) { + if (end <= 0) { return null; } @@ -132,26 +132,10 @@ const Grid = React.forwardRef((props, ref) => { } } - // Find last rowSpan column - let lastRowSpanColumns = flattenColumns.filter( - // rowSpan is not 1 - column => getRowSpan(column, end) !== 1, - ); - - let endIndex = end; - for (let i = end; i < flattenData.length; i += 1) { - lastRowSpanColumns = lastRowSpanColumns.filter(column => getRowSpan(column, i) !== 1); - - if (!lastRowSpanColumns.length) { - endIndex = Math.max(i - 1, end); - break; - } - } - // Collect the line who has rowSpan const spanLines: number[] = []; - for (let i = startIndex; i <= endIndex; i += 1) { + for (let i = startIndex; i <= end; i += 1) { const item = flattenData[i]; // This code will never reach, just incase