react-beautiful-dnd icon indicating copy to clipboard operation
react-beautiful-dnd copied to clipboard

Cursor not on the right position when dragging an item.

Open KhaldiAmer opened this issue 5 years ago • 10 comments

Expected behavior

The cursor is on the element being dragged.

Actual behavior

The cursor is away from the element which makes it hard sometimes to drag to the wanted position.

Steps to reproduce

1- Resize draggable elements when onBeforeCapture is triggered. 2- Drag second element to the last element and notice the cursor position while dragging.

Suggested solution?

None for now.

What version of React are you using?

16.11

What version of react-beautiful-dnd are you running?

12.2

What browser are you using?

Version 79.0.3945.130 (64 bits)

Demo

https://codesandbox.io/s/vertical-list-kgs03?fontsize=14&hidenavigation=1&theme=dark

KhaldiAmer avatar Feb 11 '20 16:02 KhaldiAmer

Hey there, I believe onBeforeCapture should be asynchronous (should accept a done callback) to support asynchronous evaluations on components

alexvcasillas avatar Apr 08 '20 18:04 alexvcasillas

@alexvcasillas true, not much time to do anything worthwhile. Alternatively if there was a way to set custom dimensions on drag to avoid placing a callback in the critical path.

Reference:

https://github.com/atlassian/react-beautiful-dnd/blob/c8c86601b3666b8236ff46d56daeedaf9c41e566/src/state/middleware/responders/publisher.js#L89-L105

https://github.com/atlassian/react-beautiful-dnd/blob/c8c86601b3666b8236ff46d56daeedaf9c41e566/src/state/middleware/responders/responders-middleware.js#L26-L36

https://github.com/atlassian/react-beautiful-dnd/blob/c8c86601b3666b8236ff46d56daeedaf9c41e566/src/state/middleware/lift.js#L38-L55

holmberd avatar May 31 '20 00:05 holmberd

@KhaldiAmer did you get any solution?

gabriel-os-sousa avatar Mar 30 '21 14:03 gabriel-os-sousa

@KhaldiAmer did you get any solution?

Nothing yet.

KhaldiAmer avatar Apr 07 '21 14:04 KhaldiAmer

I have the same problem

angelitolm avatar Sep 13 '21 00:09 angelitolm

were you guys able to solve this?

Kaishley avatar Nov 11 '21 13:11 Kaishley

I also ran into this problem, does anyone already have a solution?

JohnHuang-CT avatar Sep 04 '22 11:09 JohnHuang-CT

I have the same problem...

bailinx avatar Oct 09 '22 04:10 bailinx

Same..

SerejaCrystalys avatar Jul 06 '23 21:07 SerejaCrystalys

Running into the same issue. Best solution for now might just be reworking GUI to avoid this kind of interaction imo.

andrewpeterson99 avatar Apr 05 '24 17:04 andrewpeterson99