From 3cb6180eb3c24c6facc3d20d369f6d99c3dc2d99 Mon Sep 17 00:00:00 2001 From: zhouxiao Date: Fri, 23 Jul 2021 17:18:58 +0800 Subject: [PATCH] fix:Pull to Refresh is disabled when hasMore is flipped to false --- src/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 2782fbb..6b4c975 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -308,7 +308,8 @@ export default class InfiniteScroll extends Component { : document.documentElement.scrollTop ? document.documentElement : document.body; - + // to fix Pull to Refresh is disabled when hasMore is flipped to false + this.lastScrollTop = target.scrollTop; // return immediately if the action has already been triggered, // prevents multiple triggers. if (this.actionTriggered) return; @@ -323,8 +324,6 @@ export default class InfiniteScroll extends Component { this.setState({ showLoader: true }); this.props.next && this.props.next(); } - - this.lastScrollTop = target.scrollTop; }; render() {