Skip to content

Commit

Permalink
Fix jumpy disableScroll (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner authored Jun 25, 2019
1 parent d9acc71 commit dd1d994
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/js/step.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import isElement from 'lodash.iselement';
import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock/lib/bodyScrollLock.es6.js';
import { isFunction, isString, isUndefined } from './utils/type-check';
import { Evented } from './evented.js';
import { bindAdvance, bindButtonEvents, bindCancelLink, bindMethods } from './utils/bind.js';
Expand Down Expand Up @@ -422,19 +421,11 @@ export class Step extends Evented {
scrollTo(scrollToOptions) {
const { element } = this.parseAttachTo();

enableBodyScroll();

if (isFunction(this.options.scrollToHandler)) {
this.options.scrollToHandler(element);
} else if (isElement(element)) {
element.scrollIntoView(scrollToOptions);
}

setTimeout(() => {
if (this.tour.options.disableScroll) {
disableBodyScroll();
}
}, 50);
}

/**
Expand Down

0 comments on commit dd1d994

Please sign in to comment.