J
J
JeyFom2021-04-05 23:23:16
JavaScript
JeyFom, 2021-04-05 23:23:16

Why doesn't scrollRestoration work?

I need to open each page of the application from the beginning of the content, so when the application loads it is set. This works if the browser window is full screen, but if I open the devtools or reduce the window size, the next page opens scrolled down. Why doesn't scrollRestoration work in this case? window.history.scrollRestoration = 'manual'.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
ZB Venom, 2021-04-06
@zb_venom

Maybe this will help you:

document.body.scrollTop = document.documentElement.scrollTop = 0;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question