Skip to content

Commit

Permalink
Updating PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry committed Jun 19, 2024
1 parent 3acbf0b commit 1a9ba5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dev/react/src/examples/Drag-constraints-ref.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const child = {
borderRadius: 20,
}

/**
* This sibling layout animation is designed to fuzz/stress the drag constraints
* measurements. Remeasuring the constraints during drag would previously mess
* up the position of the draggable element.
*/
const SiblingLayoutAnimation = () => {
const [state, setState] = useState(false)

Expand Down Expand Up @@ -48,7 +53,6 @@ export const App = () => {
<div ref={ref} style={container}>
<motion.div
drag
//dragElastic
dragConstraints={ref}
whileTap={{ scale: 0.95 }}
whileHover={{ scale: 1.1 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import { time } from "../../frameloop/sync-time"
import { microtask } from "../../frameloop/microtask"
import { VisualElement } from "../../render/VisualElement"
import { getOptimisedAppearId } from "../../animation/optimized-appear/get-appear-id"
import { isDragActive } from "../../gestures/drag/utils/lock"

const transformAxes = ["", "X", "Y", "Z"]

Expand Down

0 comments on commit 1a9ba5c

Please sign in to comment.