Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hangfgithub opened this issue Apr 14, 2025 · 0 comments
Open

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

hangfgithub opened this issue Apr 14, 2025 · 0 comments

Comments

@hangfgithub
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant