From 74f1054c84b61f95f19be372e3fd0b19ff96350b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 21 Nov 2024 11:52:12 +0100 Subject: [PATCH] Fix the position of immovable menus on scroll See https://www.woltlab.com/community/thread/308886-dropdownignorepagescroll-bei-uisearchinput-l%C3%A4sst-dropdown-mit-ergebnissen-mitscr/ --- ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts | 2 ++ .../install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts b/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts index 8d1ba020ee..496582a0ab 100644 --- a/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts +++ b/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts @@ -69,6 +69,8 @@ function onScroll() { const menu = _menus.get(dropdown.id) as HTMLElement; if (!Core.stringToBool(menu.dataset.dropdownIgnorePageScroll || "")) { UiDropdownSimple.close(containerId); + } else { + UiDropdownSimple.setAlignment(dropdown, _menus.get(containerId)!); } } } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js index 0b3fdc65aa..33adc89af2 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js @@ -67,6 +67,9 @@ define(["require", "exports", "tslib", "../../CallbackList", "../../Core", "../. if (!Core.stringToBool(menu.dataset.dropdownIgnorePageScroll || "")) { UiDropdownSimple.close(containerId); } + else { + UiDropdownSimple.setAlignment(dropdown, _menus.get(containerId)); + } } } }); -- 2.20.1