From 9ada2a84493136f9acc0b00519ad4a2c90f84273 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 19 Aug 2020 10:00:02 +0200 Subject: [PATCH] Reset the scroll position for popovers aligned to the bottom --- .../files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js index 6dcca95d50..c4a978f4ea 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js @@ -193,8 +193,13 @@ define( // The "first" reaction is positioned as close as possible to the toggle button, // which means that we need to scroll the list to the bottom if the popover is // displayed above the toggle button. - if (UiScreen.is('screen-xs') && !this._getPopover().classList.contains('inverseOrder')) { - scrollableContainer.scrollTop = scrollableContainer.scrollHeight - scrollableContainer.clientHeight; + if (UiScreen.is('screen-xs')) { + if (this._getPopover().classList.contains('inverseOrder')) { + scrollableContainer.scrollTop = 0; + } + else { + scrollableContainer.scrollTop = scrollableContainer.scrollHeight - scrollableContainer.clientHeight; + } } } }, -- 2.20.1