Skip to content

Commit

Permalink
Fix scroll event end value
Browse files Browse the repository at this point in the history
Fixes #1383
  • Loading branch information
jhildenbiddle committed Oct 2, 2020
1 parent c2d12ed commit 04bf1ea
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

0 comments on commit 04bf1ea

Please sign in to comment.