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

Click-and-drop? #1427

Open
0xbid opened this issue Jun 9, 2024 · 0 comments
Open

Click-and-drop? #1427

0xbid opened this issue Jun 9, 2024 · 0 comments

Comments

@0xbid
Copy link

0xbid commented Jun 9, 2024

Instead of dnd-kit's default "drag-and-drop" functionality, is there any way to do something like "click-and-drop"?

These would be as follows:

  • drag-and-drop - hold down the mouse button on an attach it to your mouse cursor, and let go of the mouse button to drop it
  • click-and-drop - press the mouse button to attach an item to your mouse cursor, and press the mouse button again to drop it

"click-and-drop" is particularly useful for situations in which you want to do some operation on the item while it attached on the cursror. For any example, consider Minecraft's inventory system. You left-click an item to attach it to your mouse cursor, and while it is attached, you can right-click to drop half of the contents and leave the other half attached.

If it's possible, I would really appreciate some example code!

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

1 participant