Description
Basically this Bug again #57
The Bug is back.
I'm sadly not yet able to reproduce the bug within a jsfiddle but when we just imagine that this.$refs.vsl
can be undefined then we notice that the current condition in line 271
vue-virtual-scroll-list/dist/index.js
Lines 269 to 272 in fe5226d
in
onScroll
will fail with the error Cannot read $el of undefined
.
When we change the condition to be vsl ? (vsl.$el || vsl).scrollTop : 0;
instead then it will successfully scroll back to the top even with no wrapper defined.
A bit more about my setup and more information about the cause
I basically have this setup in nuxt where I have a dynamic url which defines which filter on the list is applied: /inbox
as url will show you all inbox items /all
will show you all the items and so on.
Now I have a sidebar which lets me navigate between the views/urls via nuxt/vue router this.$router.push({ path: '/all' })
. Now while switching back and forth I sometimes get this stacktrace https://imgur.com/a/jocKH2x with my parent component emitting beforeDestroy
in between while this plugin is in his mounted
function with a set offset
but no vsl
which leads to this error
I hope I could provide enough detail and maybe I try again to create this jsfiddle for you