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

Hitting link in different direction while scroll is animating causes jarring experience #28

Open
mordechaim opened this issue May 7, 2020 · 1 comment

Comments

@mordechaim
Copy link

mordechaim commented May 7, 2020

If the scroll is animating—say—towards the bottom of the page and I quickly press a link that causes it to scroll up, the concurrent timers causes the page to jump quickly up and down at the same time until the first animation completes.

Perhaps we should cancel any running animations when a user triggers a new animation.

mordechaim added a commit to mordechaim/react-scrollspy-nav that referenced this issue May 7, 2020
@mordechaim mordechaim mentioned this issue May 7, 2020
@mordechaim
Copy link
Author

mordechaim commented May 7, 2020

Or perhaps, instead of manual scrolling, we can use

window.scrollTo({
                top : to,
                left : start,
                behavior : 'smooth'
            });

Which natively takes care of everything without timeouts, but we can't customize duration...

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

No branches or pull requests

1 participant