steven-tey / precedent

An opinionated collection of components, hooks, and utilities for your Next.js project.
https://precedent.dev
MIT License
4.69k stars 409 forks source link

Framer Motion Exit looks like not working #16

Open huuphongnguyen opened 1 year ago

huuphongnguyen commented 1 year ago

Hello, I notice that the animation when modal is closed not working. It disappears suddenly when we click on blur to close Modal. I tried to find some solution, mostly about Framer Motion but I see there are nothing wrong. 🧐 Anyone knows how to fix it, I think UX will be better so much if we can fix it.

steven-tey commented 1 year ago

cc: @gt-codes who made this PR on Dub to fix this, but there were some caveats to it (it doesn’t allow for AnimatePresence to animate the Dialog overlay)

azaek commented 1 year ago

20 fixed PR

azaek commented 1 year ago

There are 2 AnimatePresence wrapped in total for screenWidth < 768 which causes it. Just replace the <AnimatePresence> wrap in leaflet.tsx with <>