Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions src/VirtualTable/BodyGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const Grid = React.forwardRef<GridRef, GridProps>((props, ref) => {
const { start, end, getSize, offsetY } = info;

// Do nothing if no data
if (end < 0) {
if (end <= 0) {
return null;
}

Expand All @@ -132,26 +132,10 @@ const Grid = React.forwardRef<GridRef, GridProps>((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
Expand Down