question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inverse scroll triggers next function on scroll down

See original GitHub issue

https://codesandbox.io/s/trusting-frost-q6wjc?file=/src/index.js next function is triggered due to target.scrollTop === 0 condition in line 257 https://github.com/ankeetmaini/react-infinite-scroll-component/blob/9e5ac46ca55e94543b3ca4a1276a2d7ab96a8af5/src/index.tsx#L257 when you scroll to bottom.

When you use inverse scroll and scroll up to the page, target.scrollTop is negative value. I think target.scrollTop === 0 is not the right condition for the check, I should be something like target.scrollHeight + target.scrollTop === 0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
AlaDouagicommented, Dec 16, 2020

@ankeetmaini I just opened a PR to fix this issue, please review it and merge it if everything is OK 🙏

4reactions
valdirvianacommented, Nov 12, 2020

Same problem here

Read more comments on GitHub >

github_iconTop Results From Across the Web

inverse scroll two divs - javascript - Stack Overflow
Below, I've assumed that $selects is always a set of two elements, and on load, I set the last one to be scrolled...
Read more >
Infinite scroll in reverse order #212 - bvaughn/react-virtualized
We need to be able to scroll up and load previous rows as we go, as well as to scroll down and load...
Read more >
toggleActions - ScrollTrigger - CodePen
This line's animation will play when its top edge hits the center of the viewport ( start: "top center" ), then it will...
Read more >
Reversing Scroll Animations in CSS with Waypoints
In this post, I'll show you how to reverse those animations to hide the content as the user scrolls back up the page....
Read more >
Docs | Plugins | ScrollTrigger - GreenSock
Number - An exact scroll value, so 200 would trigger when the viewport/scroller scrolls by exactly 200 pixels. Function - A function that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found