Skip to content

Commit

Permalink
Re-adds fade to collapse animation
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon committed Jul 20, 2023
1 parent e07aa77 commit 9fcd339
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/components/bookmarks/group.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ export default function BookmarksGroup({ group, disableCollapse }) {
// Otherwise the transition group does display: none and cancels animation
className="!block"
unmount={false}
enter="transition-opacity duration-200"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="transition-opacity duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
beforeLeave={() => {
panel.current.style.height = `${panel.current.scrollHeight}px`;
setTimeout(() => {panel.current.style.height = `0`}, 1);
setTimeout(() => {panel.current.style.height = "0"}, 1);
}}
beforeEnter={() => {
panel.current.style.height = `0px`;
panel.current.style.height = "0px";
setTimeout(() => {panel.current.style.height = `${panel.current.scrollHeight}px`}, 1);
}}
>
Expand Down
10 changes: 8 additions & 2 deletions src/components/services/group.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,18 @@ export default function ServicesGroup({ group, services, layout, fiveColumns, di
// Otherwise the transition group does display: none and cancels animation
className="!block"
unmount={false}
enter="transition-opacity duration-200"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="transition-opacity duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
beforeLeave={() => {
panel.current.style.height = `${panel.current.scrollHeight}px`;
setTimeout(() => {panel.current.style.height = `0`}, 1);
setTimeout(() => {panel.current.style.height = "0"}, 1);
}}
beforeEnter={() => {
panel.current.style.height = `0px`;
panel.current.style.height = "0px";
setTimeout(() => {panel.current.style.height = `${panel.current.scrollHeight}px`}, 1);
}}
>
Expand Down

0 comments on commit 9fcd339

Please sign in to comment.