Skip to content

修复当滚动到底部时,下拉刷新功能失效的问题 #408

Open

Description

@hangfgithub

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-infinite-scroll-component@6.1.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-infinite-scroll-component/dist/index.es.js b/node_modules/react-infinite-scroll-component/dist/index.es.js
index 628595f..d6182dc 100644
--- a/node_modules/react-infinite-scroll-component/dist/index.es.js
+++ b/node_modules/react-infinite-scroll-component/dist/index.es.js
@@ -287,6 +287,8 @@ var InfiniteScroll = /** @class */ (function (_super) {
                 : document.documentElement.scrollTop
                     ? document.documentElement
                     : document.body;
+            // 修复当滚动到底部时,下拉刷新功能失效的问题
+            _this.lastScrollTop = target.scrollTop;
             // return immediately if the action has already been triggered,
             // prevents multiple triggers.
             if (_this.actionTriggered)
@@ -300,7 +302,6 @@ var InfiniteScroll = /** @class */ (function (_super) {
                 _this.setState({ showLoader: true });
                 _this.props.next && _this.props.next();
             }
-            _this.lastScrollTop = target.scrollTop;
         };
         _this.state = {
             showLoader: false,
diff --git a/node_modules/react-infinite-scroll-component/dist/index.js b/node_modules/react-infinite-scroll-component/dist/index.js
index a51bb4c..642d3dc 100644
--- a/node_modules/react-infinite-scroll-component/dist/index.js
+++ b/node_modules/react-infinite-scroll-component/dist/index.js
@@ -292,6 +292,8 @@ var InfiniteScroll = /** @class */ (function (_super) {
                 : document.documentElement.scrollTop
                     ? document.documentElement
                     : document.body;
+            // 修复当滚动到底部时,下拉刷新功能失效的问题
+            _this.lastScrollTop = target.scrollTop;
             // return immediately if the action has already been triggered,
             // prevents multiple triggers.
             if (_this.actionTriggered)
@@ -305,7 +307,6 @@ var InfiniteScroll = /** @class */ (function (_super) {
                 _this.setState({ showLoader: true });
                 _this.props.next && _this.props.next();
             }
-            _this.lastScrollTop = target.scrollTop;
         };
         _this.state = {
             showLoader: false,

This issue body was partially generated by patch-package.

Activity

  1. Zeoy2020 commented on May 27, 2025

    @Zeoy2020

    我也遇到了相同的问题 应该如何解决?

  2. Sun-Liu commented on Nov 20, 2025

    @Sun-Liu

    @Zeoy2020

    Image

    看一下 你的 div 是否 与InfiniteScroll height 设置一样的值 我这边看是可以触发的

  3. Mr-lanqiufire commented on Dec 9, 2025

    @Mr-lanqiufire

    我也遇到了相同的问题 应该如何解决?

    bro,怎么解决的啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions