Skip to content

Commit 54d7b16

Browse files
committed
1.2.4
1 parent a96b855 commit 54d7b16

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

dist/InfiniteScroll.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ var InfiniteScroll = (function(_Component) {
129129
value: function componentWillUnmount() {
130130
this.detachScrollListener();
131131
this.detachMousewheelListener();
132-
},
132+
}
133133
},
134134
{
135135
key: 'isPassiveSupported',
@@ -139,30 +139,32 @@ var InfiniteScroll = (function(_Component) {
139139
var testOptions = {
140140
get passive() {
141141
passive = true;
142-
},
142+
}
143143
};
144144

145145
try {
146146
document.addEventListener('test', null, testOptions);
147+
document.removeEventListener('test', null, testOptions);
147148
} catch (e) {
148149
// ignore
149150
}
150151
return passive;
151-
},
152+
}
152153
},
153154
{
154155
key: 'eventListenerOptions',
155156
value: function eventListenerOptions() {
156-
var options = false;
157+
var options = this.props.useCapture;
157158

158159
if (this.isPassiveSupported()) {
159160
options = {
160161
useCapture: this.props.useCapture,
161-
passive: this.props.passive,
162+
passive: true
162163
};
163164
}
164165
return options;
165166
}
167+
166168
// Set a defaut loader for all your `InfiniteScroll` components
167169
},
168170
{
@@ -240,12 +242,12 @@ var InfiniteScroll = (function(_Component) {
240242
scrollEl.addEventListener(
241243
'mousewheel',
242244
this.mousewheelListener,
243-
this.options ? this.options : this.props.useCapture,
245+
this.options ? this.options : this.props.useCapture
244246
);
245247
scrollEl.addEventListener(
246248
'scroll',
247249
this.scrollListener,
248-
this.options ? this.options : this.props.useCapture,
250+
this.options ? this.options : this.props.useCapture
249251
);
250252
scrollEl.addEventListener(
251253
'resize',
@@ -263,10 +265,7 @@ var InfiniteScroll = (function(_Component) {
263265
value: function mousewheelListener(e) {
264266
// Prevents Chrome hangups
265267
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
266-
if (
267-
e.deltaY === 1 &&
268-
(!this.props.passive || !this.isPassiveSupported())
269-
) {
268+
if (e.deltaY === 1 && !this.isPassiveSupported()) {
270269
e.preventDefault();
271270
}
272271
}

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-infinite-scroller",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "Infinite scroll component for React in ES6",
55
"main": "index.js",
66
"jsnext:main": "src/InfiniteScroll.js",
@@ -9,7 +9,8 @@
99
"url": "git://github.com/CassetteRocks/react-infinite-scroller.git"
1010
},
1111
"scripts": {
12-
"build": "mkdirp dist && babel src/InfiniteScroll.js --out-file dist/InfiniteScroll.js",
12+
"build":
13+
"mkdirp dist && babel src/InfiniteScroll.js --out-file dist/InfiniteScroll.js",
1314
"prepublish": "npm run build",
1415
"test": "nyc npm run spec",
1516
"spec": "_mocha -R spec ./test/test_helper.js --recursive test/*_test.js",
@@ -22,11 +23,7 @@
2223
"git add"
2324
]
2425
},
25-
"keywords": [
26-
"infinite",
27-
"scroll",
28-
"react"
29-
],
26+
"keywords": ["infinite", "scroll", "react"],
3027
"author": "CassetteRocks",
3128
"license": "MIT",
3229
"bugs": {

0 commit comments

Comments
 (0)