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
We can prevent the default drag start trigger and implement our own using dragListener={false} and useDragControls. Is there any way of doing the same thing for ending a drag? i.e. when the user releases the mouse, can I maintain the dragging gesture until I do some task, then end it when I like?
My use case is rearrangeable elements in a CSS grid–I find that dragSnapToOrigin wigs out if I do the rearranging logic in onDragEnd, presumably because the transform is calculated from the old grid layout. My workaround is to have an element with a higher z-index than the drag element to catch the pointerup event first and do the rearranging logic before the drag gesture finishes. It would be nice if I could just defer the end of the gesture until after the rearranging is done.
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
-
We can prevent the default drag start trigger and implement our own using
dragListener={false}
anduseDragControls
. Is there any way of doing the same thing for ending a drag? i.e. when the user releases the mouse, can I maintain the dragging gesture until I do some task, then end it when I like?My use case is rearrangeable elements in a CSS grid–I find that
dragSnapToOrigin
wigs out if I do the rearranging logic inonDragEnd
, presumably because the transform is calculated from the old grid layout. My workaround is to have an element with a higher z-index than the drag element to catch thepointerup
event first and do the rearranging logic before the drag gesture finishes. It would be nice if I could just defer the end of the gesture until after the rearranging is done.Beta Was this translation helpful? Give feedback.
All reactions