diff --git a/src/components/bookmarks/group.jsx b/src/components/bookmarks/group.jsx index ef0a5ab8f..44db59fcc 100644 --- a/src/components/bookmarks/group.jsx +++ b/src/components/bookmarks/group.jsx @@ -1,3 +1,4 @@ +import { useRef } from "react"; import classNames from "classnames"; import { Disclosure, Transition } from '@headlessui/react'; import { MdKeyboardArrowDown } from "react-icons/md"; @@ -6,6 +7,7 @@ import ErrorBoundary from "components/errorboundry"; import List from "components/bookmarks/list"; export default function BookmarksGroup({ group, disableCollapse }) { + const panel = useRef(); return (
@@ -15,19 +17,24 @@ export default function BookmarksGroup({ group, disableCollapse }) {

{group.name}

{ + panel.current.style.height = `${panel.current.scrollHeight}px`; + setTimeout(() => {panel.current.style.height = `0`}, 1); + }} + beforeEnter={() => { + panel.current.style.height = `0px`; + setTimeout(() => {panel.current.style.height = `${panel.current.scrollHeight}px`}, 1); + }} > - + diff --git a/src/components/services/group.jsx b/src/components/services/group.jsx index eb64cc3d0..b3805c4f6 100644 --- a/src/components/services/group.jsx +++ b/src/components/services/group.jsx @@ -1,3 +1,4 @@ +import { useRef } from "react"; import classNames from "classnames"; import { Disclosure, Transition } from '@headlessui/react'; import { MdKeyboardArrowDown } from "react-icons/md"; @@ -7,6 +8,8 @@ import ResolvedIcon from "components/resolvedicon"; export default function ServicesGroup({ group, services, layout, fiveColumns, disableCollapse }) { + const panel = useRef(); + return (
{services.name} { + panel.current.style.height = `${panel.current.scrollHeight}px`; + setTimeout(() => {panel.current.style.height = `0`}, 1); + }} + beforeEnter={() => { + panel.current.style.height = `0px`; + setTimeout(() => {panel.current.style.height = `${panel.current.scrollHeight}px`}, 1); + }} > - +