diff --git a/src/components/structures/LeftPanel2.tsx b/src/components/structures/LeftPanel2.tsx index 0f614435e5..0e9d3dd8d0 100644 --- a/src/components/structures/LeftPanel2.tsx +++ b/src/components/structures/LeftPanel2.tsx @@ -110,6 +110,7 @@ export default class LeftPanel2 extends React.Component { const headerStickyWidth = rlRect.width - headerRightMargin; let gotBottom = false; + let lastTopHeader; for (const sublist of sublists) { const slRect = sublist.getBoundingClientRect(); @@ -126,6 +127,12 @@ export default class LeftPanel2 extends React.Component { header.classList.add("mx_RoomSublist2_headerContainer_stickyTop"); header.style.width = `${headerStickyWidth}px`; header.style.top = `${rlRect.top}px`; + if (lastTopHeader) { + lastTopHeader.style.display = "none"; + } + // first unset it, if set in last iteration + header.style.removeProperty("display"); + lastTopHeader = header; } else { header.classList.remove("mx_RoomSublist2_headerContainer_sticky"); header.classList.remove("mx_RoomSublist2_headerContainer_stickyTop");