motion icon indicating copy to clipboard operation
motion copied to clipboard

[BUG] Drag-Element gets stuck when clicked while animating

Open ChristianK43 opened this issue 1 year ago • 1 comments

2. Describe the bug

When using an element with drag and dragConstraints enabled, the element gets stuck if it is quickly clicked while moving back inside its constraints after being dragged outside the defined boundaries. This can also happen when not using dragConstraints but instead animating the element onDragEnd.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug example without dragConstraints

example with dragConstraints

4. Steps to reproduce

Steps to reproduce the behavior:

  1. Drag the Element outside of its contraints
  2. Release the element and quickly click it again
  3. Element is now stuck

5. Expected behavior

The element should continue moving inside its constraints after the mouse is released

6. Video or screenshots

https://github.com/framer/motion/assets/68615332/b0035081-b1bf-4eef-951a-6709d0650042

7. Environment details

Chrome 125, macOS 14.5

ChristianK43 avatar Jun 10 '24 11:06 ChristianK43

Fix PR: https://github.com/framer/motion/pull/2758 PTAL! 🙇

injae-kim avatar Aug 10 '24 13:08 injae-kim