Skip to content

Commit

Permalink
Update Accordion.tsx and Search.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Jul 5, 2024
1 parent 905a874 commit 6388187
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion backend/src/components/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ const Properties = () => {
className="filter"
agencies={allAgencies}
onChange={handleAgencyFilterChange}
collapse={!env.isMobile()}
/>
<PropertyTypeFilter
className="filter"
Expand Down

0 comments on commit 6388187

Please sign in to comment.