Skip to content

Commit 8011d8b

Browse files
author
Guillaume Chau
committed
Buffer is now around pool
1 parent 4db0d31 commit 8011d8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/VirtualScroller.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ export default {
227227
228228
const buffer = parseInt(this.buffer)
229229
const poolSize = parseInt(this.poolSize)
230-
const scrollTop = ~~((scroll.top - buffer) / poolSize) * poolSize
231-
const scrollBottom = ~~(Math.ceil((scroll.bottom + buffer) / poolSize)) * poolSize
230+
const scrollTop = ~~(scroll.top / poolSize) * poolSize - buffer
231+
const scrollBottom = Math.ceil(scroll.bottom / poolSize) * poolSize + buffer
232232
233233
if (!force && scrollTop === this._oldScrollTop && scrollBottom === this._oldScrollBottom) {
234234
return

0 commit comments

Comments
 (0)