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 height = itemHeights[key] || 0
let currentOffset = totalOffset let currentOffset = totalOffset
totalOffset += height totalOffset += height
let isBelowViewport = (currentOffset < scrollTop) let isAboveViewport = (currentOffset < scrollTop)
if (isBelowViewport) { if (isAboveViewport) {
if (scrollTop - renderBuffer > currentOffset) { if ((scrollTop - height - renderBuffer) > currentOffset) {
continue // below the area we want to render continue // above the area we want to render
} }
} else { } else {
if (currentOffset > (scrollTop + height + renderBuffer)) { if (currentOffset > (scrollTop + height + renderBuffer)) {
break // above the area we want to render break // below the area we want to render
} }
} }
visibleItems.push({ visibleItems.push({