actually run restoreWindowScrollPos in a microtask

This commit is contained in:
tophf 2018-08-16 18:06:28 +03:00
parent 24fdad5f41
commit adc165723c

View File

@ -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) {