mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Tweaking autoscroll to only adjust if header stuck at top and not at bottom
This commit is contained in:
parent
b9e95865af
commit
5f9c794f0c
1 changed files with 3 additions and 4 deletions
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue