@@ -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 }
0 commit comments