actually run restoreWindowScrollPos in a microtask
This commit is contained in:
parent
24fdad5f41
commit
adc165723c
|
@ -882,7 +882,7 @@ onDOMready().then(() => {
|
||||||
function restoreWindowScrollPos({immediately = true} = {}) {
|
function restoreWindowScrollPos({immediately = true} = {}) {
|
||||||
if (!immediately) {
|
if (!immediately) {
|
||||||
// run in the next microtask cycle
|
// run in the next microtask cycle
|
||||||
new Promise(() => restoreWindowScrollPos({immediately: true}));
|
Promise.resolve().then(restoreWindowScrollPos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (window.scrollX !== state.scrollX || window.scrollY !== state.scrollY) {
|
if (window.scrollX !== state.scrollX || window.scrollY !== state.scrollY) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user