Reset the scroll position for popovers aligned to the bottom
authorAlexander Ebert <ebert@woltlab.com>
Wed, 19 Aug 2020 08:00:02 +0000 (10:00 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 19 Aug 2020 08:00:02 +0000 (10:00 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js

index 6dcca95d500a6886bb6a697d3327fb93dda24880..c4a978f4ea20af227ff01fe73d9f830a749d9f1e 100644 (file)
@@ -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;
+                                               }
                                        }
                                }
                        },