Skip to content
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

Merged
merged 3 commits into from Nov 1, 2021

Conversation

mattgperry
Copy link
Collaborator

Fixes #424

@mattgperry mattgperry requested a review from nvh November 1, 2021 14:14
@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 1, 2021

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:

Sandbox Source
Framer Motion: Simple animation Configuration
App Store UI using React and Framer Motion Configuration
Framer Motion: Reorder animation Configuration
Framer Motion: growing item positionTransition issue Configuration
Framer Motion: Image lightbox Configuration

@@ -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.
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor

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?

@mattgperry mattgperry added the automerge Land this PR label Nov 1, 2021
@mergetron mergetron bot merged commit 1c8b07b into main Nov 1, 2021
@mergetron mergetron bot deleted the fix/drag-percent-conversion branch November 1, 2021 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Land this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Drag doesn't apply any unit conversion
2 participants