From c91d8faa9c60cf0f5126e5cc80f2938d7339ee4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Oldag?= Date: Fri, 24 Jan 2020 14:56:56 +0100 Subject: [PATCH] Fix handling of resize event --- src/InfiniteScroll.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/InfiniteScroll.js b/src/InfiniteScroll.js index 332f7bd..aabb82e 100644 --- a/src/InfiniteScroll.js +++ b/src/InfiniteScroll.js @@ -126,7 +126,7 @@ export default class InfiniteScroll extends Component { this.scrollListener, this.options ? this.options : this.props.useCapture ); - scrollEl.removeEventListener( + window.removeEventListener( 'resize', this.scrollListener, this.options ? this.options : this.props.useCapture @@ -168,7 +168,7 @@ export default class InfiniteScroll extends Component { this.scrollListener, this.options ? this.options : this.props.useCapture ); - scrollEl.addEventListener( + window.addEventListener( 'resize', this.scrollListener, this.options ? this.options : this.props.useCapture