Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resized dragged item loses position from cursor #41

Closed
KenanYusuf opened this issue Jan 7, 2021 · 3 comments
Closed

Resized dragged item loses position from cursor #41

KenanYusuf opened this issue Jan 7, 2021 · 3 comments

Comments

@KenanYusuf
Copy link

I am trying to recreate the sortable grid with a large first tile example from Storybook and seeing an issue with dragging to and from the first item's position. It looks like the transform position of the dragged item is incorrect in relation to the user's cursor (see video below).

Example

See the code here:
https://codesandbox.io/s/ecstatic-pine-zs8nj?file=/src/SortableItem.jsx

Kapture.2021-01-07.at.14.37.19.mp4

Thanks for making such an intuitive drag and drop library, really excited to see this project progress!

@clauderic
Copy link
Owner

Hey @KenanYusuf, currently variable sized grid only works well when using a <DragOverlay/>

@KenanYusuf
Copy link
Author

@clauderic thank you, I've managed to get the desired effect with DragOverlay!

For anyone interested in a working version of this: https://codesandbox.io/s/vigorous-sanderson-hdysk

@clauderic
Copy link
Owner

clauderic commented Jan 7, 2021

This looks great, thanks for sharing back with the community @KenanYusuf ❤️

Made a few minor tweaks:

https://codesandbox.io/s/dndkit-sortable-image-grid-py6ve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants