react-infinite-scroller
react-infinite-scroller copied to clipboard
fix: take parentNode scrollHeight into account when using non-window scroller
Currently, the calculation is wrong when using a parentNode scroller. It takes the component element's scrollHeight into account instead of the scroller's.
This patch amends that.
Math Example:
Scroll viewport:
- Client Height is 667px (iPhone 6 height)
- Scroll height is 1000px (more than viewport)
- Scroll top is 100px
In this case, to get a proper offset we need to calculate 1000 - 667 - 100 to the real offset of 233, which should cause a new scroll load (assuming default threshold).