fix bug where large items might not be rendered when scrolling up

This commit is contained in:
Nolan Lawson 2018-03-14 18:38:26 -07:00
parent a2744cddb0
commit 2db30856f9
1 changed files with 5 additions and 5 deletions

View File

@ -40,14 +40,14 @@ virtualListStore.compute('rawVisibleItems',
let height = itemHeights[key] || 0
let currentOffset = totalOffset
totalOffset += height
let isBelowViewport = (currentOffset < scrollTop)
if (isBelowViewport) {
if (scrollTop - renderBuffer > currentOffset) {
continue // below the area we want to render
let isAboveViewport = (currentOffset < scrollTop)
if (isAboveViewport) {
if ((scrollTop - height - renderBuffer) > currentOffset) {
continue // above the area we want to render
}
} else {
if (currentOffset > (scrollTop + height + renderBuffer)) {
break // above the area we want to render
break // below the area we want to render
}
}
visibleItems.push({