Skip to content

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

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajoslin
Copy link

@ajoslin ajoslin commented Jun 11, 2017

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 ajoslin force-pushed the non-window-scroll branch from e904e15 to 0a17028 Compare June 11, 2017 15:43
@ajoslin ajoslin changed the title fix: take parentNode clientHeight into account when using non-window scroller fix: take parentNode scrollHeight into account when using non-window scroller Jun 11, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant