Skip to content
Permalink
Browse files

fix: onDone not being called with force: true (references #111) (#129)

Change applies in case there is no need to scroll.
  • Loading branch information...
rchl authored and rigor789 committed Sep 10, 2019
1 parent e3cab59 commit 6ff03b2aec0f71ce5b74fd69d482d718a5c0484c
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/scrollTo.js
@@ -202,15 +202,19 @@ export const scroller = () => {
}
}

if (onStart) onStart(element);

if (!diffY && !diffX) {
onDone(element);
return;
}

if (typeof easing === "string") {
easing = easings[easing] || easings["ease"];
}

easingFn = BezierEasing.apply(BezierEasing, easing);

if (!diffY && !diffX) return;
if (onStart) onStart(element);

_.on(container, abortEvents, abortFn, { passive: true });

window.requestAnimationFrame(step);

0 comments on commit 6ff03b2

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