Open gapplef opened 5 years ago
I am having the same issue. Does anyone have an idea how to fix it?
Okay I found the reason for this behavior:
Pjax sets scrollRestoration to 'manual': https://github.com/MoOx/pjax/blob/7940a6e3e595dae970f670b0abfc2cc03d74d614/index.js#L26
You can configure this by setting 'scrollRestoration' to false:
new Pjax({
scrollRestoration: false,
});
@bjoernhasse This solved my problem, thanks!
According to the README
scrollRestoration
(Boolean, default: true) When set to true, Pjax will attempt to restore the scroll position when navigating backwards or forwards.
What does this mean?
I'm using Hexo to generate my personal website, and the theme
NexT
I used provide PJAX support. After enable PJAX, the scroll position back to top of the page on every refresh. Is it possible to restore the scroll position at page refresh?