Skip to content

Commit b3c6513

Browse files
Fix bug: Virtual Grid increments page size when no results left to render (#3877)
1 parent a9bdc70 commit b3c6513

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/common/VirtualGrid.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@ const state = computed<GridState>(() => {
7070
const fromCol = fromRow * cols.value
7171
const toCol = toRow * cols.value
7272
const remainingCol = items.length - toCol
73+
const hasMoreToRender = remainingCol >= 0
7374
7475
return {
7576
start: clamp(fromCol, 0, items?.length),
7677
end: clamp(toCol, fromCol, items?.length),
77-
isNearEnd: remainingCol <= cols.value * bufferRows
78+
isNearEnd: hasMoreToRender && remainingCol <= cols.value * bufferRows
7879
}
7980
})
8081
const renderedItems = computed(() =>

0 commit comments

Comments
 (0)