-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
1. Read the FAQs 👇
2. Describe the bug
I have an element in my app that is both draggable and resizable. On first render, the element's drag constraints are set as the element's parent container ref. The drag constraints work perfectly up until the element's dimensions are changed. When this happens, the drag constraints do not update as a result of which the resized element begins overflowing the parent container.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://codesandbox.io/p/sandbox/framer-motion-drag-constraints-issue-r233cy
4. Steps to reproduce
Steps to reproduce the behavior:
- Open the sandbox link shared above
- Drag the modal around the screen edges to confirm that the drag constraints are working as expected
- Resize the modal using the resize handle located towards to bottom right
- Drag the resized modal towards the edges to see the modal overflow / underflow the screen
5. Expected behavior
When a draggable element is resized, it's drag behavior around the drag limits remains the same as before. It does not unexpectedly begin overflowing / underflowing the drag limits.
6. Video or screenshots