Vuetify: 1.0.8
Vue: 2.5.16
Browsers: Firefox 59.0
OS: Linux x86_64
Make sure to use Align to bottom for the preview window (top right buttons in preview window), such that the preview has a scrolling bar.
1) Click on toolbar link: Scroll does not work.
2) Click on v-btn: Show and scroll to second.
The second <v-card> element is set to be visible and the window is scrolled to its position.
An error is thrown, because $vuetify.goTo is called before the element is rendered on the page:
[Vue warn]: Error in event handler for "click": "TypeError: document.querySelector(...) is null" found in
---> <VBtn>
<ScrollWorks> at /src/components/ScrollDoesNotWork.vue
<VContent>
<VApp>
<App> at /src/App.vue
<Root>
getTargetLocation@https://j34w7zj5j9.codesandbox.io/node_modules/vuetify/dist/vuetify.js:5760:16
goTo@https://j34w7zj5j9.codesandbox.io/node_modules/vuetify/dist/vuetify.js:5777:24 toggle_show_second@https://j34w7zj5j9.codesandbox.io/src/components/ScrollDoesNotWork.vue?31ef14ae:111:7 invoker@https://j34w7zj5j9.codesandbox.io/node_modules/vue/dist/vue.common.js:2029:14 eventsMixin/Vue.prototype.$emit@https://j34w7zj5j9.codesandbox.io/node_modules/vue/dist/vue.common.js:2540:11 click@https://j34w7zj5j9.codesandbox.io/node_modules/vuetify/dist/vuetify.js:7250:7 invoker@https://j34w7zj5j9.codesandbox.io/node_modules/vue/dist/vue.common.js:2029:14 withMacroTask/fn._withTask@https://j34w7zj5j9.codesandbox.io/node_modules/vue/dist/vue.common.js:1828:15
https://vuejs.org/v2/api/#vm-nextTick
this.second_visible = true
this.$nextTick(() => this.$vuetify.goTo('#second_vcard'))
Most helpful comment
https://vuejs.org/v2/api/#vm-nextTick