motion icon indicating copy to clipboard operation
motion copied to clipboard

[BUG] Drag constraints change unexpectedly when in certain states

Open jjkavalam opened this issue 2 years ago • 0 comments

1. Read the FAQs 👇

2. Describe the bug

Give a clear and concise description of what the bug is.

Certain animation states seem to mess with the effective drag constraints. It is best explained by the code sandbox link below.

Basically, i should be able to drag the box any where within the specified drag constraints in all states. But under certain conditions the effective drag constraints applied by framer motion is different from what is specified.

Those edge cases seems to be triggered by states that set properties such as width.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/p/sandbox/framer-motion-drag-reset-attempt-forked-pcthq9

4. Steps to reproduce

Steps to reproduce the behavior:

  1. Go to the linked Code Sand box and follow the instructions on screen.

5. Expected behavior

Drag constraints are consistently applied in all states.

6. Video or screenshots

Video recording: https://drive.google.com/file/d/1UwgWnUmrQ5kCBfA344MlmwDCn0qB9cSk/view?usp=sharing

7. Environment details

If applicable, let us know which OS, browser, browser version etc you're using.

Mac / Chrome

jjkavalam avatar Jan 13 '24 06:01 jjkavalam