From c10fa2704c6db969b560be311a66d4659f4ea137 Mon Sep 17 00:00:00 2001 From: spnayan Date: Mon, 29 Apr 2024 21:52:57 +0545 Subject: [PATCH] Fix More Filter popover overlay height --- frontend/src/views/project.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/project.js b/frontend/src/views/project.js index 6f1fbdfcb4..d180ea7dc8 100644 --- a/frontend/src/views/project.js +++ b/frontend/src/views/project.js @@ -175,13 +175,13 @@ export const MoreFilters = () => { const { top, left, height, width } = filterElement.getBoundingClientRect(); const { height: containerHeight } = projectContainerElement.getBoundingClientRect(); - setScrollHeight(window.scrollY); - setProjectContainerHeight(containerHeight); + const navbarHeight = document.getElementById('explore-nav').offsetHeight; + // calculate difference between explore project page and navbar to set popover overlay height + setProjectContainerHeight(containerHeight - navbarHeight); setPosition({ top, left, height, width }); + setScrollHeight(window.scrollY); }, [filterElement, width, projectContainerElement]); - console.log(scrollHeight, 'scroll height'); - useEffect(() => { const contentHeight = document.getElementById('explore-nav').offsetHeight +