@@ -298,7 +298,7 @@ export default {
298
298
299
299
// Skip update if use hasn't scrolled enough
300
300
if (checkPositionDiff) {
301
- let positionDiff = scroll .start - this .$_lastUpdateScrollPosition
301
+ let positionDiff = scroll .originalStart - this .$_lastUpdateScrollPosition
302
302
if (positionDiff < 0 ) positionDiff = - positionDiff
303
303
if ((itemSize === null && positionDiff < minItemSize) || positionDiff < itemSize) {
304
304
return {
@@ -315,7 +315,7 @@ export default {
315
315
endIndex = this .prerender
316
316
totalSize = null
317
317
} else {
318
- this .$_lastUpdateScrollPosition = scroll .start
318
+ this .$_lastUpdateScrollPosition = scroll .originalStart
319
319
320
320
const buffer = this .buffer
321
321
scroll .start -= buffer
@@ -507,37 +507,42 @@ export default {
507
507
getScroll () {
508
508
const { $el: el , direction } = this
509
509
const isVertical = direction === ' vertical'
510
- let scrollState
511
510
512
511
if (this .pageMode ) {
513
512
const bounds = el .getBoundingClientRect ()
514
513
const boundsSize = isVertical ? bounds .height : bounds .width
515
- let start = - (isVertical ? bounds .top : bounds .left )
516
- let size = isVertical ? window .innerHeight : window .innerWidth
514
+ const originalStart = - (isVertical ? bounds .top : bounds .left )
515
+ const originalSize = isVertical ? window .innerHeight : window .innerWidth
516
+ let start = originalStart
517
+ let size = originalSize
518
+
517
519
if (start < 0 ) {
518
520
size += start
519
521
start = 0
520
522
}
521
523
if (start + size > boundsSize) {
522
524
size = boundsSize - start
523
525
}
524
- scrollState = {
526
+ return {
527
+ originalStart,
525
528
start,
526
529
end: start + size,
527
530
}
528
- } else if (isVertical) {
529
- scrollState = {
531
+ }
532
+
533
+ if (isVertical) {
534
+ return {
535
+ originalStart: el .scrollTop ,
530
536
start: el .scrollTop ,
531
537
end: el .scrollTop + el .clientHeight ,
532
538
}
533
539
} else {
534
- scrollState = {
540
+ return {
541
+ originalStart: el .scrollLeft ,
535
542
start: el .scrollLeft ,
536
543
end: el .scrollLeft + el .clientWidth ,
537
544
}
538
545
}
539
-
540
- return scrollState
541
546
},
542
547
543
548
applyPageMode () {
0 commit comments