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 am facing delay issue in the drag and drop of a item. I need to modify logic depends on the business requirement. I have attached the following code snap shot. onMouseDown={() => { clicked = true; }} onMouseMove={(event) => { if (clicked) { var rect = event.currentTarget.getBoundingClientRect(); mousePosition = event.clientX - Math.floor(rect.left); props.onMouseDown(event); localStorage.setItem( "click-position", JSON.stringify({ postion: mousePosition, lengthOfPill: eventMetaData.width, }) );
Here props.onMouseDown function is DnD/toolkit's native mouse down event. This function is only responsible for Drag.
Hi Team,
I am facing delay issue in the drag and drop of a item. I need to modify logic depends on the business requirement. I have attached the following code snap shot.
onMouseDown={() => { clicked = true; }} onMouseMove={(event) => { if (clicked) { var rect = event.currentTarget.getBoundingClientRect(); mousePosition = event.clientX - Math.floor(rect.left); props.onMouseDown(event); localStorage.setItem( "click-position", JSON.stringify({ postion: mousePosition, lengthOfPill: eventMetaData.width, }) );
Here props.onMouseDown function is DnD/toolkit's native mouse down event. This function is only responsible for Drag.
Also I added the Provider Snapshot
<DndContext
collisionDetection={pointerWithin}
onDragStart={(event) => handleDragStart(event, { dispatch })}
onDragEnd={(event) =>
somefunction(event)
}
modifiers={[restrictToWindowEdges]}
sensors={sensors}
>
I used useDraggable and useDropable hook to make the component Draggable and dropable
The text was updated successfully, but these errors were encountered: