clauderic / dnd-kit

The modern, lightweight, performant, accessible and extensible drag & drop toolkit for React.
http://dndkit.com
MIT License
12.91k stars 640 forks source link

Draggable desync with cursor position on scroll #1224

Open sylvainDNS opened 1 year ago

sylvainDNS commented 1 year ago

Thanks clauderic for the great work on this library! I know that a new implementation is in an experimental state, but I think it's important to record this issue.

Expected Behavior

As a user when I scroll while I drag an item using a DragOverlay, the draggable item AND the DragOverlay follow the cursor position.

Current Behavior

As a user when I scroll while I drag an item using a DragOverlay, the draggable item doesn't follow the cursor position while the DragOverlay does.

Detailed Description

It is an edge case where I want to use the original draggable item AND a draggable overlay to add visual elements around the draggable.

Demo

You can find a demo here: https://codesandbox.io/s/dnd-kit-scroll-overlay-6kpmz4?file=%2Fsrc%2FApp.tsx

mateusduraes commented 2 days ago

I do have the same problem, even without using the DragOverlay component.

Did you find any solution?