mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
Fix bug: Virtual Grid increments page size when no results left to render (#3877)
This commit is contained in:
@@ -70,11 +70,12 @@ const state = computed<GridState>(() => {
|
|||||||
const fromCol = fromRow * cols.value
|
const fromCol = fromRow * cols.value
|
||||||
const toCol = toRow * cols.value
|
const toCol = toRow * cols.value
|
||||||
const remainingCol = items.length - toCol
|
const remainingCol = items.length - toCol
|
||||||
|
const hasMoreToRender = remainingCol >= 0
|
||||||
|
|
||||||
return {
|
return {
|
||||||
start: clamp(fromCol, 0, items?.length),
|
start: clamp(fromCol, 0, items?.length),
|
||||||
end: clamp(toCol, fromCol, items?.length),
|
end: clamp(toCol, fromCol, items?.length),
|
||||||
isNearEnd: remainingCol <= cols.value * bufferRows
|
isNearEnd: hasMoreToRender && remainingCol <= cols.value * bufferRows
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const renderedItems = computed(() =>
|
const renderedItems = computed(() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user