q-loading and scollIntoView
-
If I use q-loading, I can’t use scrollIntoView() method. Any advice? Thanks!
this.$q.loading.show() this.$q.loading.hide() this.$nextTick(() => { if (this.$route.hash) { const el = document.querySelector(this.$route.hash) el && el.scrollIntoView() } }
-
Did you add to your plugins In Quasar.conf? plugins: [‘Loading’]
-
Yes, I did. Loading part works, but I could not make scrollIntoView() work.
-
the
el
is selected fine. But the scrolling does not happen. -
@qjh if you make a marking codepen example it would be easier to help find the problem.
-
I found that I had this problem as well. I believe (though don’t quote me on this) that according to the documentation there is a 500ms delay to prevent flicker. I am not sure if this is the case when it is hidden. Regardless, but if a delay of 500ms is introduced before calling the scrollIntoView function it works. Although in my case I was using the Scroll Utils to do the scrolling.