Skip to content

Commit

Permalink
Merge pull request #1384 from docsifyjs/fix/1383
Browse files Browse the repository at this point in the history
Fix scroll event end value
  • Loading branch information
jhildenbiddle committed Oct 5, 2020
2 parents 7f0c42e + b45f444 commit 4742660
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/event/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function scrollTo(el, offset = 0) {
enableScrollEvent = false;
scroller = new Tweezer({
start: window.pageYOffset,
end: el.getBoundingClientRect().top + window.pageYOffset - offset,
end:
Math.round(el.getBoundingClientRect().top) + window.pageYOffset - offset,
duration: 500,
})
.on('tick', v => window.scrollTo(0, v))
Expand Down

1 comment on commit 4742660

@vercel
Copy link

@vercel vercel bot commented on 4742660 Oct 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.