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

Incorrect visibility calculation with {force: false, offset: nonZero} #138

Closed
nburlett opened this issue Apr 11, 2019 · 1 comment · Fixed by #139

Comments

@nburlett
Copy link
Contributor

commented Apr 11, 2019

The scroller can incorrectly decide that an element is already visible when
specifying {force: false, offset: nonZero}. The code checks if targetY is
within the current visible portion of container, but targetY has the
offset applied already.

*------------*
| container  |
| above      |
*~ ~ ~ ~ ~ ~ * container top
|            |
| visible    |
| area       |
|            | <-| 
|            |   |
|            |   |
|            |   | skips scrolling if elm
*~ ~ ~ ~ ~ ~ *   | is within this area
| *-------*  |   | 
| | elm   |  |   |
| *-------*  |   |
|            | <-|
| container  |
| below      |
*------------*
nburlett added a commit to nburlett/vue-scrollto that referenced this issue Apr 11, 2019
Fix calculation for {force: false, offset: nonZero}
Undo the pre-applied offset when calculating whether the element is already
visible (and therefore we shouldn't scroll).

Fixes rigor789#138
rigor789 added a commit that referenced this issue Sep 10, 2019
fix: calculation for {force: false, offset: nonZero} (#139)
Undo the pre-applied offset when calculating whether the element is already
visible (and therefore we shouldn't scroll).

Fixes #138
@rigor789

This comment has been minimized.

Copy link
Owner

commented Sep 10, 2019

🎉 This issue has been resolved in version 2.16.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rigor789 rigor789 added the released label Sep 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.