From adc165723c549c3466d86f4c25b492dbbf4aea74 Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 16 Aug 2018 18:06:28 +0300 Subject: [PATCH] actually run restoreWindowScrollPos in a microtask --- edit/global-search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edit/global-search.js b/edit/global-search.js index d4fffafe..c8bdaa5c 100644 --- a/edit/global-search.js +++ b/edit/global-search.js @@ -882,7 +882,7 @@ onDOMready().then(() => { function restoreWindowScrollPos({immediately = true} = {}) { if (!immediately) { // run in the next microtask cycle - new Promise(() => restoreWindowScrollPos({immediately: true})); + Promise.resolve().then(restoreWindowScrollPos); return; } if (window.scrollX !== state.scrollX || window.scrollY !== state.scrollY) {