The best way to use transition-group with Portal. #718
Answered
by
thetarnav
rabbitkiller-dev
asked this question in
Q&A
-
When using transition to implement animations, the portal has an animation when opening the modal, but no animation when closing it. The reason is that the portal's div is directly removed. What should be done? import { type TransitionMode, createSwitchTransition } from "@solid-primitives/transition-group";
(
<Show when={props.visible}>
<Portal>
<div class="fl-modal-wrap size-full fixed top-0 start-0 z-[80] overflow-x-hidden overflow-y-auto pointer-events-none" tabIndex="-1">
<PopoverTransition mode="in-out">
<div class="hs-overlay-animation-target sm:max-w-lg sm:w-full m-3 sm:mx-auto min-h-[calc(100%-3.5rem)] flex items-center">
....
</div>
</PopoverTransition>
</div>
</Portal>
</Show>
) |
Beta Was this translation helpful? Give feedback.
Answered by
thetarnav
Nov 9, 2024
Replies: 2 comments
-
I believe that the same tricks can be applied here: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rabbitkiller-dev
-
This example solved my problem |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe that the same tricks can be applied here:
solidjs-community/solid-transition-group#8