motiondivision / motiondivision/motion

[BUG] Drag constraints change unexpectedly when in certain states

Open
#2,488 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
33.7k
Forks
1.4k
Avg merge
1d 10h
Merged PRs (30d)
14

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and follow its on-screen instructions in Chrome to observe how drag constraints change across animation states. Inspect the drag-constraint behavior around states that set properties such as width; done means the specified constraints remain consistently effective in every state.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.