Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant