From 579ed7f28547d13fd5f3474bcb8f42da5b039be3 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 5 Jul 2023 12:39:34 +0200 Subject: [PATCH] Remove a legacy workaround for scroll disable See https://www.woltlab.com/community/thread/300504-woltlab-suite-6-seite-scrollt-bei-schlie%C3%9Fen-von-modal-fenster-kurz-nach-oben/ --- ts/WoltLabSuite/Core/Ui/Screen.ts | 5 +---- wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ts/WoltLabSuite/Core/Ui/Screen.ts b/ts/WoltLabSuite/Core/Ui/Screen.ts index 79c6620f31..bd59cdef9a 100644 --- a/ts/WoltLabSuite/Core/Ui/Screen.ts +++ b/ts/WoltLabSuite/Core/Ui/Screen.ts @@ -136,10 +136,7 @@ export function scrollEnable(): void { } if (_scrollTop) { - // Slightly delay this to prevent conflicts caused by a CSS recalculation. - window.setTimeout(() => { - document[_scrollOffsetFrom].scrollTop = ~~_scrollTop; - }, 0); + document[_scrollOffsetFrom].scrollTop = ~~_scrollTop; } } } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js index 0f1336752b..13265a4f05 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js @@ -122,10 +122,7 @@ define(["require", "exports", "tslib", "../Core", "../Environment"], function (r pageContainer.style.removeProperty("margin-top"); } if (_scrollTop) { - // Slightly delay this to prevent conflicts caused by a CSS recalculation. - window.setTimeout(() => { - document[_scrollOffsetFrom].scrollTop = ~~_scrollTop; - }, 0); + document[_scrollOffsetFrom].scrollTop = ~~_scrollTop; } } } -- 2.20.1