Skip to content

[BUG] onDrag with layout transition not firing closing animation, onDragEnd does #2248

@benmneb

Description

@benmneb

In version 1 of Framer Motion, onDrag with layoutTransition behaves as expected... once the onDrag function is called the animation completes and the element returns to it's original position.

v1, expected behaviour: https://codesandbox.io/s/framermotion-v1-ondrag-4x2n7j?file=/src/Card.tsx

But in the latest package (10.x) with onDrag the closing animation is not run (it just jumps to the end?) and it moves the element down the page. However, using onDragEnd with the latest package it does do these things again, but obvioulsy the drag needs to be released first, which is not the desired behaviour.

v10.x, current behaviour: https://codesandbox.io/s/framermotion-ondrag-wjlr7r?file=/src/Card.tsx

Every version I tried >= 2.0.0 has strange behaviour with this. As per the changelog at v2 the onDrag had breaking changes.

Am I just missing something with the change, cause it seems like this functionality should still be available, or did something break?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions