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 multiple issues with non-window scrolling context #20

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jedwards1211
Copy link

This fixes the following issues when scrolling with a context besides the window:

  • it was using 0 for the start position instead of the context's scrollTop
  • it wasn't determining the end position correctly (should be el.getBoundingClientRect().top - context.getBoundingClientRect().top + context.scrollTop)
  • smooth scrolling to the end wouldn't ease out in some cases. Solution: clamp the end position to context.scrollHeight - context.offsetHeight

Note that this still doesn't work if there are nested scrolling elements between the context and the target element.

Also, this includes my other PR by accident. Let me know if you want to remove that PR from this.

@alicelieutier
Copy link
Owner

Hey, I'd like to remove the other PR from this. Other than this, I'm happy to merge this patch.
I'll comment on the other one individually.

Sorry for the long wait :/

@jedwards1211
Copy link
Author

No worries, I think it's inevitable on projects that one isn't paid to maintain...I've been even slower to keep up with some of my own

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.

3 participants