From 5f9c794f0cb4d41b8b98120a2edda2ee16d25ea5 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Fri, 26 Aug 2016 15:36:16 +0100 Subject: [PATCH] Tweaking autoscroll to only adjust if header stuck at top and not at bottom --- src/components/views/rooms/RoomList.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index a020a168d8..1c507e6629 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -354,15 +354,14 @@ module.exports = React.createClass({ var topStuckHeight = stickyHeight * i; var bottomStuckHeight = stickyHeight * (stickyWrappers.length - i) - if (scrollToPosition !== undefined && stickyPosition === scrollToPosition) { - scrollStuckOffset = topStuckHeight; - } - if (self.scrollAreaSufficient && stickyPosition <= (scrollArea.scrollTop + topStuckHeight)) { // Top stickies sticky.dataset.stuck = "top"; stickyHeader.classList.add("mx_RoomSubList_fixed"); stickyHeader.style.top = scrollArea.offsetTop + topStuckHeight + "px"; + if (scrollToPosition !== undefined && stickyPosition === scrollToPosition) { + scrollStuckOffset = topStuckHeight; + } } else if (self.scrollAreaSufficient && stickyPosition >= ((scrollArea.scrollTop + scrollAreaHeight) - bottomStuckHeight)) { /// Bottom stickies sticky.dataset.stuck = "bottom";