You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Tweaking autoscroll to only adjust if header stuck at top and not at bottom
This commit is contained in:
@@ -354,15 +354,14 @@ module.exports = React.createClass({
|
|||||||
var topStuckHeight = stickyHeight * i;
|
var topStuckHeight = stickyHeight * i;
|
||||||
var bottomStuckHeight = stickyHeight * (stickyWrappers.length - i)
|
var bottomStuckHeight = stickyHeight * (stickyWrappers.length - i)
|
||||||
|
|
||||||
if (scrollToPosition !== undefined && stickyPosition === scrollToPosition) {
|
|
||||||
scrollStuckOffset = topStuckHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self.scrollAreaSufficient && stickyPosition <= (scrollArea.scrollTop + topStuckHeight)) {
|
if (self.scrollAreaSufficient && stickyPosition <= (scrollArea.scrollTop + topStuckHeight)) {
|
||||||
// Top stickies
|
// Top stickies
|
||||||
sticky.dataset.stuck = "top";
|
sticky.dataset.stuck = "top";
|
||||||
stickyHeader.classList.add("mx_RoomSubList_fixed");
|
stickyHeader.classList.add("mx_RoomSubList_fixed");
|
||||||
stickyHeader.style.top = scrollArea.offsetTop + topStuckHeight + "px";
|
stickyHeader.style.top = scrollArea.offsetTop + topStuckHeight + "px";
|
||||||
|
if (scrollToPosition !== undefined && stickyPosition === scrollToPosition) {
|
||||||
|
scrollStuckOffset = topStuckHeight;
|
||||||
|
}
|
||||||
} else if (self.scrollAreaSufficient && stickyPosition >= ((scrollArea.scrollTop + scrollAreaHeight) - bottomStuckHeight)) {
|
} else if (self.scrollAreaSufficient && stickyPosition >= ((scrollArea.scrollTop + scrollAreaHeight) - bottomStuckHeight)) {
|
||||||
/// Bottom stickies
|
/// Bottom stickies
|
||||||
sticky.dataset.stuck = "bottom";
|
sticky.dataset.stuck = "bottom";
|
||||||
|
|||||||
Reference in New Issue
Block a user