Skip to content

Commit dd47289

Browse files
committed
fix: scrollState value
1 parent 0f2e362 commit dd47289

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/vue-virtual-scroller/src/components/RecycleScroller.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,9 @@ export default {
636636
const boundsSize = isVertical ? bounds.height : bounds.width
637637
let start = -(isVertical ? bounds.top : bounds.left)
638638
let size = isVertical ? window.innerHeight : window.innerWidth
639-
if (start < 0) {
639+
let originStart = isVertical ? bounds.top : bounds.left;
640+
// Fix start value when the el is scrolling from under the viewport to the middle of the viewport
641+
if (start < 0 && !(originStart > 0 && originStart < size)) {
640642
size += start
641643
start = 0
642644
}

0 commit comments

Comments
 (0)