Fixed race condition when scroll to 0 intends to happend after page-switch
This commit is contained in:
parent
b0fefb4690
commit
ccf5954091
|
@ -625,7 +625,8 @@ window.onscroll = function(e) {
|
||||||
return;
|
return;
|
||||||
if (scroll() === 0)
|
if (scroll() === 0)
|
||||||
setTimeout(async function() {
|
setTimeout(async function() {
|
||||||
if (scroll() === 0) {
|
if (scroll() === 0 && page() !== null &&
|
||||||
|
page().onScroll !== undefined) {
|
||||||
await page().onScroll(0, true);
|
await page().onScroll(0, true);
|
||||||
window.scrollTo(0,0);
|
window.scrollTo(0,0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue