diff --git a/dist/InfiniteScroll.js b/dist/InfiniteScroll.js index 1008a80..5bb22a3 100644 --- a/dist/InfiniteScroll.js +++ b/dist/InfiniteScroll.js @@ -129,7 +129,7 @@ var InfiniteScroll = (function(_Component) { value: function componentWillUnmount() { this.detachScrollListener(); this.detachMousewheelListener(); - }, + } }, { key: 'isPassiveSupported', @@ -139,30 +139,32 @@ var InfiniteScroll = (function(_Component) { var testOptions = { get passive() { passive = true; - }, + } }; try { document.addEventListener('test', null, testOptions); + document.removeEventListener('test', null, testOptions); } catch (e) { // ignore } return passive; - }, + } }, { key: 'eventListenerOptions', value: function eventListenerOptions() { - var options = false; + var options = this.props.useCapture; if (this.isPassiveSupported()) { options = { useCapture: this.props.useCapture, - passive: this.props.passive, + passive: true }; } return options; } + // Set a defaut loader for all your `InfiniteScroll` components }, { @@ -240,12 +242,12 @@ var InfiniteScroll = (function(_Component) { scrollEl.addEventListener( 'mousewheel', this.mousewheelListener, - this.options ? this.options : this.props.useCapture, + this.options ? this.options : this.props.useCapture ); scrollEl.addEventListener( 'scroll', this.scrollListener, - this.options ? this.options : this.props.useCapture, + this.options ? this.options : this.props.useCapture ); scrollEl.addEventListener( 'resize', @@ -263,10 +265,7 @@ var InfiniteScroll = (function(_Component) { value: function mousewheelListener(e) { // Prevents Chrome hangups // See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257 - if ( - e.deltaY === 1 && - (!this.props.passive || !this.isPassiveSupported()) - ) { + if (e.deltaY === 1 && !this.isPassiveSupported()) { e.preventDefault(); } } diff --git a/package.json b/package.json index 107b433..472928b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-infinite-scroller", - "version": "1.2.3", + "version": "1.2.4", "description": "Infinite scroll component for React in ES6", "main": "index.js", "jsnext:main": "src/InfiniteScroll.js", @@ -9,7 +9,8 @@ "url": "git://github.com/CassetteRocks/react-infinite-scroller.git" }, "scripts": { - "build": "mkdirp dist && babel src/InfiniteScroll.js --out-file dist/InfiniteScroll.js", + "build": + "mkdirp dist && babel src/InfiniteScroll.js --out-file dist/InfiniteScroll.js", "prepublish": "npm run build", "test": "nyc npm run spec", "spec": "_mocha -R spec ./test/test_helper.js --recursive test/*_test.js", @@ -22,11 +23,7 @@ "git add" ] }, - "keywords": [ - "infinite", - "scroll", - "react" - ], + "keywords": ["infinite", "scroll", "react"], "author": "CassetteRocks", "license": "MIT", "bugs": {