react-infinite-scroller icon indicating copy to clipboard operation
react-infinite-scroller copied to clipboard

fix: take parentNode scrollHeight into account when using non-window scroller

Open ajoslin opened this issue 8 years ago • 0 comments

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).

ajoslin avatar Jun 11 '17 15:06 ajoslin