motion icon indicating copy to clipboard operation
motion copied to clipboard

fix inertia: take care of the case when t is zero

Open chuganzy opened this issue 1 year ago • 10 comments

This PR aims to fix an issue where Reorder.Item randomly gets stuck as I posted here.

Related:

  • https://github.com/framer/motion/issues/2101
  • https://github.com/framer/motion/pull/2231

As noted here:

requestAnimationFrame timestamps can come through as lower than the startTime

which means that startTime possibly can be equal to currentTime and t is 0 in that case. inertia returns the state with done: true in that case, and stops the animation immediately.

chuganzy avatar Jul 28 '23 16:07 chuganzy

Is it possible to add a test on inertia for this behaviour?

mattgperry avatar Aug 03 '23 10:08 mattgperry

@mattgperry Thank you for your comment and indeed. Just addressed here. Please let me know!

chuganzy avatar Aug 03 '23 13:08 chuganzy

Is there an update on this PR? Having issues with reorders as well

ekatzenstein avatar Sep 16 '23 00:09 ekatzenstein

@ekatzenstein their is this PR #2231 waiting to be merged as well

nick-keller avatar Sep 26 '23 10:09 nick-keller

Is there anything blocking getting this merged in? It seems like a high impact, edge case fix that includes a test

davisg123 avatar Sep 29 '23 16:09 davisg123

Shouldn't this be merged? It looks like a very simple fix that is tested. Or maybe I am missing something?

nick-keller avatar Oct 17 '23 08:10 nick-keller

Is there an update on this? I'm also having similar issues with reordering

marwhyte avatar Oct 27 '23 12:10 marwhyte

@mattgperry any chance we could have these 2 PRs merged please? The issue has been affecting our production for a while too

bel0v avatar Oct 27 '23 17:10 bel0v

Seeing the recent activity, I am bringing this PR up again! @mattgperry it is the last brik to fix the re-order component that is broken!

nick-keller avatar Dec 05 '23 14:12 nick-keller

Should this PR be merged or closed?

nick-keller avatar Jan 15 '24 09:01 nick-keller

Closing as the added failing test was fixed by a update in the meantime (changing the > on that line to a >=)

mattgperry avatar Jul 24 '24 10:07 mattgperry