Merge pull request #4783 from matrix-org/travis/room-list/sticky-headers-reliability

Clear `top` when not sticking headers to the top
pull/21833/head
Travis Ralston 2020-06-18 07:48:46 -06:00 committed by GitHub
commit c26513b1e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -108,6 +108,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
header.classList.add("mx_RoomSublist2_headerContainer_sticky"); header.classList.add("mx_RoomSublist2_headerContainer_sticky");
header.classList.add("mx_RoomSublist2_headerContainer_stickyBottom"); header.classList.add("mx_RoomSublist2_headerContainer_stickyBottom");
header.style.width = `${headerStickyWidth}px`; header.style.width = `${headerStickyWidth}px`;
header.style.top = `unset`;
gotBottom = true; gotBottom = true;
} else if (slRect.top < top) { } else if (slRect.top < top) {
header.classList.add("mx_RoomSublist2_headerContainer_sticky"); header.classList.add("mx_RoomSublist2_headerContainer_sticky");
@ -119,6 +120,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
header.classList.remove("mx_RoomSublist2_headerContainer_stickyTop"); header.classList.remove("mx_RoomSublist2_headerContainer_stickyTop");
header.classList.remove("mx_RoomSublist2_headerContainer_stickyBottom"); header.classList.remove("mx_RoomSublist2_headerContainer_stickyBottom");
header.style.width = `unset`; header.style.width = `unset`;
header.style.top = `unset`;
} }
} }
}; };