diff --git a/index.js b/index.js index b3c8e30..8131169 100644 --- a/index.js +++ b/index.js @@ -32,11 +32,12 @@ export default class Smooth { ticking: false } this.vs = this.vars.native ? null : new vs({ - limitInertia: this.options.vs && this.options.vs.limitInertia || false, + limitInertia: this.options.vs && this.options.vs.hasOwnProperty('limitInertia') ? this.options.vs.limitInertia : false, mouseMultiplier: this.options.vs && this.options.vs.mouseMultiplier || 1, touchMultiplier: this.options.vs && this.options.vs.touchMultiplier || 1.5, firefoxMultiplier: this.options.vs && this.options.vs.firefoxMultiplier || 30, - preventTouch: this.options.vs && this.options.vs.preventTouch || true + preventTouch: this.options.vs && this.options.vs.hasOwnProperty('preventTouch') ? this.options.vs.preventTouch : true, + useKeyboard: this.options.vs && this.options.vs.hasOwnProperty('useKeyboard') ? this.options.vs.useKeyboard : true, }) this.dom = { listener: this.options.listener || document.body, diff --git a/smooth-scrolling.js b/smooth-scrolling.js index 1522109..1109a4a 100644 --- a/smooth-scrolling.js +++ b/smooth-scrolling.js @@ -57,11 +57,12 @@ function () { ticking: false }; this.vs = this.vars["native"] ? null : new _virtualScroll["default"]({ - limitInertia: this.options.vs && this.options.vs.limitInertia || false, + limitInertia: this.options.vs && this.options.vs.hasOwnProperty('limitInertia') ? this.options.vs.limitInertia : false, mouseMultiplier: this.options.vs && this.options.vs.mouseMultiplier || 1, touchMultiplier: this.options.vs && this.options.vs.touchMultiplier || 1.5, firefoxMultiplier: this.options.vs && this.options.vs.firefoxMultiplier || 30, - preventTouch: this.options.vs && this.options.vs.preventTouch || true + preventTouch: this.options.vs && this.options.vs.hasOwnProperty('preventTouch') ? this.options.vs.preventTouch : true, + useKeyboard: this.options.vs && this.options.vs.hasOwnProperty('useKeyboard') ? this.options.vs.useKeyboard : true }); this.dom = { listener: this.options.listener || document.body,