File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ var InfiniteScroll = (function(_Component) {
117117 key : 'componentWillUnmount' ,
118118 value : function componentWillUnmount ( ) {
119119 this . detachScrollListener ( ) ;
120+ this . detachMousewheelListener ( ) ;
120121 } ,
121122
122123 // Set a defaut loader for all your `InfiniteScroll` components
@@ -128,8 +129,8 @@ var InfiniteScroll = (function(_Component) {
128129 } ,
129130 } ,
130131 {
131- key : 'detachScrollListener ' ,
132- value : function detachScrollListener ( ) {
132+ key : 'detachMousewheelListener ' ,
133+ value : function detachMousewheelListener ( ) {
133134 var scrollEl = window ;
134135 if ( this . props . useWindow === false ) {
135136 scrollEl = this . scrollComponent . parentNode ;
@@ -140,6 +141,16 @@ var InfiniteScroll = (function(_Component) {
140141 this . mousewheelListener ,
141142 this . props . useCapture ,
142143 ) ;
144+ } ,
145+ } ,
146+ {
147+ key : 'detachScrollListener' ,
148+ value : function detachScrollListener ( ) {
149+ var scrollEl = window ;
150+ if ( this . props . useWindow === false ) {
151+ scrollEl = this . scrollComponent . parentNode ;
152+ }
153+
143154 scrollEl . removeEventListener (
144155 'scroll' ,
145156 this . scrollListener ,
You can’t perform that action at this time.
0 commit comments