Reset scrollTop to 0 before expanding in WoltLabSuite/Core/Bbcode/Collapsible
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 3 Jun 2020 16:21:10 +0000 (18:21 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 3 Jun 2020 16:22:39 +0000 (18:22 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Bbcode/Collapsible.js

index a691f67a7dbbaf579db755e1c29dcbd75592aade..20b0d5d595590081db73810eff114fb3cc3ddd67 100644 (file)
@@ -76,9 +76,11 @@ define([], function() {
                                                
                                                // expand boxes that are initially scrolled
                                                if (overflowContainer.scrollTop !== 0) {
+                                                       overflowContainer.scrollTop = 0;
                                                        toggle();
                                                }
                                                overflowContainer.addEventListener('scroll', function () {
+                                                       overflowContainer.scrollTop = 0;
                                                        if (container.classList.contains('collapsed')) {
                                                                toggle();
                                                        }