This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Samarth Bahuguna
Posted Jul 16 - Read on Facebook

What's the difference between onDragEnd and onDragAnimationEnd?

I want a way to detect when a layer bounces back to it's original position after being dragged and released. I want the instant when all the momentum, bouncing etc. has finished. What's the best way to achieve this?


Eelco Lempsink

Hi Samarth, the ‘drag end‘ event triggers when you let go, the ‘drag animation end’ when the resulting animation finishes, so the latter is the one you’re looking for. Here’s a small project demonstrating the difference:

Samarth Bahuguna

That's what I understood too but my code wasn't behaving as expected. I was triggering several animations on other elements on drag end, and the onDragAnimationEnd got triggered at the same instant as onDragEnd. It was working correctly with a simple example like the one you shared.

I used some workaround to make it work eventually. Thanks anyway!

Read the entire post on Facebook