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

Cannot detect drop on trash container when dragging sortable cards #1594

Open
RikidWai opened this issue Jan 27, 2025 · 0 comments
Open

Cannot detect drop on trash container when dragging sortable cards #1594

RikidWai opened this issue Jan 27, 2025 · 0 comments

Comments

@RikidWai
Copy link

I'm trying to implement a drag-to-delete functionality using DND Kit where users can drag cards to a trash container to delete them. However, the trash container is not being detected when I drag cards over it.

Current Behavior:

  • Cards can be dragged
  • When dragging over the trash container, over.id in the console shows the card's ID instead of 'trash'
  • Unable to detect when cards are dropped on the trash container
  • Can reorder by dragging the card around

Expected Behavior:

  • When dragging a card over the trash container, over.id should show 'trash'
  • Cards should be deleted when dropped on the trash container

Minimal Reproducible Example: https://codesandbox.io/p/sandbox/react-web-share-forked-4rv43d?workspaceId=ws_HG9faLN6koXDysuaxGXbmt

Question: Why isn't the trash container being detected as the drop target when I drag cards over it? How can I fix this to properly implement the drag-to-delete functionality? Any help is appreciated.

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