diff --git a/backend/src/components/Accordion.tsx b/backend/src/components/Accordion.tsx index a8d4c2ba..acc600f1 100644 --- a/backend/src/components/Accordion.tsx +++ b/backend/src/components/Accordion.tsx @@ -43,10 +43,11 @@ const Accordion = ({ }, [collapse]) useEffect(() => { - if (accordionRef.current) { + if (collapse && accordionRef.current) { const panel = accordionRef.current.nextElementSibling as HTMLDivElement panel.style.maxHeight = `${panel.scrollHeight + offsetHeight}px` } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [offsetHeight]) return ( diff --git a/frontend/src/components/Accordion.tsx b/frontend/src/components/Accordion.tsx index a8d4c2ba..acc600f1 100644 --- a/frontend/src/components/Accordion.tsx +++ b/frontend/src/components/Accordion.tsx @@ -43,10 +43,11 @@ const Accordion = ({ }, [collapse]) useEffect(() => { - if (accordionRef.current) { + if (collapse && accordionRef.current) { const panel = accordionRef.current.nextElementSibling as HTMLDivElement panel.style.maxHeight = `${panel.scrollHeight + offsetHeight}px` } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [offsetHeight]) return ( diff --git a/frontend/src/pages/Search.tsx b/frontend/src/pages/Search.tsx index eb55db59..ee16681d 100644 --- a/frontend/src/pages/Search.tsx +++ b/frontend/src/pages/Search.tsx @@ -113,7 +113,6 @@ const Properties = () => { className="filter" agencies={allAgencies} onChange={handleAgencyFilterChange} - collapse={!env.isMobile()} />