atlassian / pragmatic-drag-and-drop

Fast drag and drop for any experience on any tech stack
https://atlassian.design/components/pragmatic-drag-and-drop
Other
7.67k stars 146 forks source link

Mouse Pointer Stuck to Top Left in Drag Preview Despite Using `preserveOffsetOnSource` Utility #54

Open RabiRoshan opened 2 weeks ago

RabiRoshan commented 2 weeks ago

Issue:

I'm attempting to replicate the Board Example, but I'm encountering an issue where the mouse pointer on the drag preview is consistently stuck to the top left corner, unlike the example in the documentation. I'm unsure if I'm misinterpreting the utility preserveOffsetOnSource, but it doesn't seem to work for me. In the meantime, I found a workaround using the solution mentioned here: https://github.com/atlassian/pragmatic-drag-and-drop/issues/25#issuecomment-2043678626. It would be fantastic if this issue could be resolved according to the documentation.

This library is excellent, and I would love to contribute! ❤️

Versions:

Import used:

import { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source'
alexreardon commented 2 weeks ago

Hi there,

Could you please post a codesandbox with the issue you are experiencing? It's difficult to know what is going on without an example to play with.

RabiRoshan commented 1 week ago

Hey @alexreardon, here is the codesandbox as requested: https://codesandbox.io/p/sandbox/pragmatic-dnd-preserveoffsetonsource-kr2cz2

alexreardon commented 1 week ago

Thank you for the example. It's really helpful. Taking a look now