#Scrollto

20 messages · Page 1 of 1 (latest)

ashen otter
#

I've implemented pagination for fetched data and on every paage click I would need to scroll to top, do you have suggestion?

wanton condor
ashen otter
#

yep, first thing I did and it does not react to it.:/

wanton condor
#

I'm using that in quite a few different places

ashen otter
#

could you send me use case pls?

wanton condor
ashen otter
#

I just placed it same way to my watcher

#

and even it goes through, finally no window movement.

wanton condor
#

well could be tons of factors depending on your your html and css is setup I guess

#

so hard to tell for me

#

could also try playing with setTimeout/nextTick

ashen otter
#

thanks for advice. I just found out, the window.scrollTo works for scroll of full page, I am scrolling in nested divider and there its not working:/

wanton condor
#

yep wont work for nested things

#

can try grabbing the ref of the container then and scrolling to that I guess

ashen otter
#

I will check, many thanks!

#

this works

wanton condor
#

I'd rather use template refs instead of accessing the document itself but if it works 👍

#

also maybe do the process.client check in the scroll function instead of in the watch to avoid repeating the check

ashen otter
#

you are absolutely right, thx🚀