-
Heya! I'm trying to add enter and exit animations to my dialog. The enter animation works but the exit animation doesn't as the component seems to be unmounted right away. I would have expected it to defer unmount but it doesn't seem to do so. Here's my code: <Dialog.Root>
<Dialog.Trigger asChild>
<button className="bg-red-500">Open dialog</button>
</Dialog.Trigger>
<Dialog.Portal>
<div className="fixed inset-0 isolate z-50 flex items-center justify-center">
<Dialog.Overlay className="DialogOverlay fixed inset-0 bg-gray-900/30" />
<Dialog.Content className="DialogContent fixed inset-0 top-8 z-50 overflow-hidden rounded-t-3xl bg-white">
<p>This is the content</p>
</Dialog.Content>
</div>
</Dialog.Portal>
</Dialog.Root> The I'm not sure if I'm doing anything wrong on my end. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @Murkrage, here an example on how to add exit animation to dialog |
Beta Was this translation helpful? Give feedback.
-
Thanks @joaom00. I had the code setup exactly as your example but I did figure out an issue on my end! The wrapping div inside the |
Beta Was this translation helpful? Give feedback.
Hi @Murkrage, here an example on how to add exit animation to dialog
https://codesandbox.io/p/sandbox/pedantic-aryabhata-1ykgmk