New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converting x/y from percent to pixels before drag starts #1322
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f3d04eb:
|
dev/tests/drag.tsx
Outdated
@@ -2,6 +2,15 @@ import { motion } from "@framer" | |||
import * as React from "react" | |||
|
|||
// It's important for this test to only trigger a single rerender while dragging (in response to onDragStart) of draggable component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this comment go below the helper function? Or maybe the helper function should move to the bottom of the file?
} | ||
} | ||
|
||
this.originPoint[axis] = current as number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the cast here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could check if it is undefined and not set it otherwise, right?
Fixes #424