From 70e6b6ca0863c0e86519eaed1a8453352ea5c238 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 3 May 2023 11:33:09 +0200 Subject: [PATCH] Force a synchronous recalculation of the position The inconsistent updates add a lot of visual noice when scrolling the page. --- ts/WoltLabSuite/Core/Date/Picker.ts | 2 +- wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ts/WoltLabSuite/Core/Date/Picker.ts b/ts/WoltLabSuite/Core/Date/Picker.ts index 0b0121023c..8966dba41c 100644 --- a/ts/WoltLabSuite/Core/Date/Picker.ts +++ b/ts/WoltLabSuite/Core/Date/Picker.ts @@ -329,7 +329,7 @@ function open(event: MouseEvent): void { UiAlignment.set(_datePicker!, _input!); }; _updatePosition(); - window.addEventListener("scroll", _updatePosition, { passive: true }); + window.addEventListener("scroll", _updatePosition, { passive: false }); _input.nextElementSibling!.setAttribute("aria-expanded", "true"); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js index 9f03db6b42..ac47aa04d5 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js @@ -277,7 +277,7 @@ define(["require", "exports", "tslib", "../Core", "./Util", "../Dom/Change/Liste UiAlignment.set(_datePicker, _input); }; _updatePosition(); - window.addEventListener("scroll", _updatePosition, { passive: true }); + window.addEventListener("scroll", _updatePosition, { passive: false }); _input.nextElementSibling.setAttribute("aria-expanded", "true"); _focusTrap.activate(); } -- 2.20.1