Force a synchronous recalculation of the position
authorAlexander Ebert <ebert@woltlab.com>
Wed, 3 May 2023 09:33:09 +0000 (11:33 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 3 May 2023 09:33:09 +0000 (11:33 +0200)
The inconsistent updates add a lot of visual noice when scrolling the page.

ts/WoltLabSuite/Core/Date/Picker.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js

index 0b0121023c5a5f93e82cdbb56b1a337e116f104f..8966dba41caeab926f0576ef5a34638844a6fc6d 100644 (file)
@@ -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");
 
index 9f03db6b426684afda3c27bce5da321b6bfbe2c6..ac47aa04d5244abeac922a15dcc54446ad98f801 100644 (file)
@@ -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();
     }