Skip to content

(Reorder.Item) Disable animations when not dragging? #2832

Closed Answered by tajbowness
tajbowness asked this question in Q&A
Discussion options

You must be logged in to vote

Setting layout to false in Reorder.Item helps.

https://www.framer.com/motion/reorder/##layout-animations

EDIT: If it doesn't work properly, add this to Reorder.Item instead

const [dragging, setDragging] = useState(false);

...

onDragStart={() => setDragging(true)}
onDragEnd={() => setDragging(false)}
transition={dragging ? { duration: 0.2 } : { duration: 0 }}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tajbowness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant