Skip to content

Commit

Permalink
fix: scrollState value
Browse files Browse the repository at this point in the history
  • Loading branch information
tl-94 committed Nov 10, 2023
1 parent 0f2e362 commit dd47289
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,9 @@ export default {
const boundsSize = isVertical ? bounds.height : bounds.width
let start = -(isVertical ? bounds.top : bounds.left)
let size = isVertical ? window.innerHeight : window.innerWidth
if (start < 0) {
let originStart = isVertical ? bounds.top : bounds.left;
// Fix start value when the el is scrolling from under the viewport to the middle of the viewport
if (start < 0 && !(originStart > 0 && originStart < size)) {
size += start
start = 0
}
Expand Down

0 comments on commit dd47289

Please sign in to comment.