-
Notifications
You must be signed in to change notification settings - Fork 5
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
Infinite scroll up and down (with :root { scroll-behavior: smooth }
css)
#24
Comments
Resolves runkids#24 ## What was the problem? For some reason, `window.scrollY` is not 0 right after calling `window.scrollTo(0, 0)`, so the `step` function is called infinitely. ## What is the solution? `return` from `step` function after `window.scrollTo(0, 0)`
I investigated the issue a bit and it seems to be only happening with bootstrap v5, I had bootstrap v4 previously and it worked fine. |
Hi @slaweet , thanks your report. I will check this issue. |
Thank you @runkids. I created a reproduction repo to make it easier to check. The 3 commits should illustrate the issue nicely: https://github.com/slaweet/vue-scroll-up-and-down-issue/commits/main
|
I pinned the issue down to bootstrap setting |
:root { scroll-behavior: smooth }
css)
Expected behaviour
Clicking the scroll top button scrolls up
Actual behaviour
Clicking the scroll top button scrolls up and down infinitelly
![dodgy-scroll-to-top](https://user-images.githubusercontent.com/1254342/130058353-e0b6b6fb-b0f2-4284-aebb-4607350be101.gif)
Environment Info:
System:
OS: Linux 5.4 Ubuntu 18.04.5 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Binaries:
Node: 16.4.0 - ~/.nvm/versions/node/v16.4.0/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 7.18.1 - ~/.nvm/versions/node/v16.4.0/bin/npm
Browsers:
Firefox: 91.0
npmPackages:
ts-vue-plugin: 0.1.3 => 0.1.3
typescript: 4.3.5 => 4.3.5
vue: 2.6.14 => 2.6.14
vue-scroll-up: 1.0.3 => 1.0.3
bootstrap: 5.1.0 => 5.1.0
bootstrap-vue: 2.21.2 => 2.21.2
The text was updated successfully, but these errors were encountered: