From b370e3f0788b889e24adafafcee7e5d361081705 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 3 Jul 2020 16:52:01 +0200 Subject: [PATCH] don't need to set width with javascript? --- res/css/views/rooms/_RoomSublist2.scss | 1 + src/components/structures/LeftPanel2.tsx | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/res/css/views/rooms/_RoomSublist2.scss b/res/css/views/rooms/_RoomSublist2.scss index 16ae88768b..e86bf9fbe4 100644 --- a/res/css/views/rooms/_RoomSublist2.scss +++ b/res/css/views/rooms/_RoomSublist2.scss @@ -71,6 +71,7 @@ limitations under the License. z-index: 1; // over top of other elements, but still under the ones in the visible list height: 32px; // to match the header container // width set by JS + width: calc(100% - 22px); } &.mx_RoomSublist2_headerContainer_stickyBottom { diff --git a/src/components/structures/LeftPanel2.tsx b/src/components/structures/LeftPanel2.tsx index 0e9d3dd8d0..45830445ca 100644 --- a/src/components/structures/LeftPanel2.tsx +++ b/src/components/structures/LeftPanel2.tsx @@ -119,13 +119,11 @@ export default class LeftPanel2 extends React.Component { if (slRect.top + headerHeight > bottom && !gotBottom) { header.classList.add("mx_RoomSublist2_headerContainer_sticky"); header.classList.add("mx_RoomSublist2_headerContainer_stickyBottom"); - header.style.width = `${headerStickyWidth}px`; header.style.top = `unset`; gotBottom = true; } else if (slRect.top < top) { header.classList.add("mx_RoomSublist2_headerContainer_sticky"); header.classList.add("mx_RoomSublist2_headerContainer_stickyTop"); - header.style.width = `${headerStickyWidth}px`; header.style.top = `${rlRect.top}px`; if (lastTopHeader) { lastTopHeader.style.display = "none"; @@ -137,7 +135,6 @@ export default class LeftPanel2 extends React.Component { header.classList.remove("mx_RoomSublist2_headerContainer_sticky"); header.classList.remove("mx_RoomSublist2_headerContainer_stickyTop"); header.classList.remove("mx_RoomSublist2_headerContainer_stickyBottom"); - header.style.width = `unset`; header.style.top = `unset`; } }