Skip to content
Permalink
Browse files

fix: calculation for {force: false, offset: nonZero} (#139)

Undo the pre-applied offset when calculating whether the element is already
visible (and therefore we shouldn't scroll).

Fixes #138
  • Loading branch information...
nburlett authored and rigor789 committed Sep 10, 2019
1 parent cbe0c1a commit f01ce23bb71f7cfec31b77411de3c426ac7c8a9f
Showing with 1 addition and 511 deletions.
  1. +1 −1 src/scrollTo.js
  2. +0 −510 vue-scrollto.js
@@ -196,7 +196,7 @@ export const scroller = () => {
: container.offsetHeight;
const containerTop = initialY;
const containerBottom = containerTop + containerHeight;
const elementTop = targetY;
const elementTop = targetY - offset;
const elementBottom = elementTop + element.offsetHeight;
if (
elementTop >= containerTop &&

0 comments on commit f01ce23

Please sign in to comment.
You can’t perform that action at this time.