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
[Bug Report] GoTo element with offset above top of page locks scrolling #3384
Comments
It also seems just specifying a negative scroll value has the same effect, for example: |
offsetTop for h1-6 also doesn't work properly. |
Also, it does not work in the production build. Using it with |
Is there any solution for this bug? It practically makes scrolling impossible with goTo method. |
I've created a PR to possibly fix this issue. In the meantime the best thing to do is make sure whatever you pass to let pos =
element.offsetTop // if using an element
VueComponent.$el.offsetTop // if using a Vue component
document.querySelector('#element-near-top').offsetTop // if using a string
20 // if using a number
const offset = -100
const pos = Math.max(pos + offset, 0)
this.$vuetify.goTo(pos) |
it was possible to pass a negative value for the scroll position, causing it to get stuck fixes #3384
Versions and Environment
Vuetify: 1.0.3
Vue: 2.5.13
Browsers: Chrome 64.0.3282.167
OS: Mac OS 10.13.3
Steps to reproduce
$vuetify.goTo('#element-near-top', { offset: -100 })
where the offset will attempt to scroll past the top of the pageExpected Behavior
Page will scroll down
Actual Behavior
Page keeps bouncing back to the top preventing you from scrolling
Reproduction Link
https://codepen.io/BenShelton/pen/jZeNMg
The text was updated successfully, but these errors were encountered: