atlassian / react-beautiful-dnd

Beautiful and accessible drag and drop for lists with React
https://react-beautiful-dnd.netlify.app
Other
33.21k stars 2.53k forks source link

Cursor not on the right position when dragging an item. #1748

Open KhaldiAmer opened 4 years ago

KhaldiAmer commented 4 years ago

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

alexvcasillas commented 4 years ago

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

holmberd commented 4 years ago

@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

gabriel-os-sousa commented 3 years ago

@KhaldiAmer did you get any solution?

KhaldiAmer commented 3 years ago

@KhaldiAmer did you get any solution?

Nothing yet.

angelitolm commented 3 years ago

I have the same problem

Kaishley commented 2 years ago

were you guys able to solve this?

JohnHuang-CT commented 2 years ago

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

bailinx commented 1 year ago

I have the same problem...

SerejaCrystalys commented 1 year ago

Same..

andrewpeterson99 commented 5 months ago

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