Inverse scroll triggers next function on scroll down
See original GitHub issuehttps://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:
- Created 3 years ago
- Reactions:9
- Comments:10 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ankeetmaini I just opened a PR to fix this issue, please review it and merge it if everything is OK 🙏
Same problem here