You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that in motion.div the props have replaced the react's onDragStart related events with custom dragging gesture events, while the latter ones seem not providing the dataTransfer feature of the original events.
I use motion mainly for style animation instead of gesture recognition, and I sometimes run into cases where I want a div to have animated styles while also supporting draggable and dataTransfer. It seems that I cannot get the original onDragStart event back?
But when I ignored the type mismatch and treated the onDragStart as the original onDragStart, I did get the react's DragEvent with dataTransfer as long as I set draggable to true and drag to false, but I'm not sure whether it's reliable. Is it the expected behavior? Is the TypeScript mismatch just a typing issue?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that in
motion.divthe props have replaced the react'sonDragStartrelated events with custom dragging gesture events, while the latter ones seem not providing thedataTransferfeature of the original events.I use motion mainly for style animation instead of gesture recognition, and I sometimes run into cases where I want a div to have animated styles while also supporting
draggableanddataTransfer. It seems that I cannot get the originalonDragStartevent back?But when I ignored the type mismatch and treated the
onDragStartas the originalonDragStart, I did get the react'sDragEventwithdataTransferas long as I setdraggableto true anddragto false, but I'm not sure whether it's reliable. Is it the expected behavior? Is the TypeScript mismatch just a typing issue?Beta Was this translation helpful? Give feedback.
All reactions