From: Alexander Ebert Date: Wed, 19 Aug 2020 08:00:02 +0000 (+0200) Subject: Reset the scroll position for popovers aligned to the bottom X-Git-Tag: 5.3.0_Alpha_1~48^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ada2a84493136f9acc0b00519ad4a2c90f84273;p=GitHub%2FWoltLab%2FWCF.git Reset the scroll position for popovers aligned to the bottom --- 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; + } } } },