motiondivision / motiondivision/motion
[BUG] dragConstraints by ref doesn't consider changes after initial render
Nobody has claimed this yet.
- 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
If dragConstraints are set by giving a ref of an element, then the size of the draggable element is based off the initial render and not the current size.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
4. Steps to reproduce
Steps to reproduce the behavior:
- Go to Sandbox.
- Click on button in top left corner.
- Draggable area for box is the same.
5. Expected behavior
The draggable area should change to accomodate the change in size.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CodeSandbox reproduction in src/Example.tsx and run it to observe the constraint after the button changes the element size. Trace the dragConstraints ref handling from the reproduced behavior into the relevant source and tests. Done means the draggable area updates to accommodate the changed size.
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
- 45/100