Merge pull request #4926 from matrix-org/t3chguy/room-list/14318
Fix sticky headers being left on display:none if they change too quickly
This commit is contained in:
@@ -146,6 +146,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
|
|||||||
const slRect = sublist.getBoundingClientRect();
|
const slRect = sublist.getBoundingClientRect();
|
||||||
|
|
||||||
const header = sublist.querySelector<HTMLDivElement>(".mx_RoomSublist2_stickable");
|
const header = sublist.querySelector<HTMLDivElement>(".mx_RoomSublist2_stickable");
|
||||||
|
header.style.removeProperty("display"); // always clear display:none first
|
||||||
|
|
||||||
if (slRect.top + headerHeight > bottom && !gotBottom) {
|
if (slRect.top + headerHeight > bottom && !gotBottom) {
|
||||||
header.classList.add("mx_RoomSublist2_headerContainer_sticky");
|
header.classList.add("mx_RoomSublist2_headerContainer_sticky");
|
||||||
@@ -161,8 +162,6 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
|
|||||||
if (lastTopHeader) {
|
if (lastTopHeader) {
|
||||||
lastTopHeader.style.display = "none";
|
lastTopHeader.style.display = "none";
|
||||||
}
|
}
|
||||||
// first unset it, if set in last iteration
|
|
||||||
header.style.removeProperty("display");
|
|
||||||
lastTopHeader = header;
|
lastTopHeader = header;
|
||||||
} else {
|
} else {
|
||||||
header.classList.remove("mx_RoomSublist2_headerContainer_sticky");
|
header.classList.remove("mx_RoomSublist2_headerContainer_sticky");
|
||||||
|
|||||||
Reference in New Issue
Block a user