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

Differentiate between dropped on self vs non-droppable area #336

Closed
ssilve1989 opened this issue Feb 18, 2018 · 3 comments
Closed

Differentiate between dropped on self vs non-droppable area #336

ssilve1989 opened this issue Feb 18, 2018 · 3 comments

Comments

@ssilve1989
Copy link

Bug or feature request?

Feature Request

It would be useful to know onDragEnd, if the source was dropped on itself or the destination really was null (i.e. not a droppable area)

My particular use case, is that I am creating "tear-out" tabs (a la Chrome). How I determine whether or not to "tear-out" is by checking if the destination was null, meaning the user has dragged a tab outside the droppable area. With no way to differentiate between dropped on self vs non-droppable area, the tear-out action occurs when the former occurs.

Alternatively, it could be useful to get access to the event onDragEnd to determine the mouse position. (Please if I missed that somewhere let me know)

Expected behavior

Destination could be populated with the self-index instead of null when dropping on self.

Actual behavior

Destination is null

Steps to reproduce

Drag an item around a droppable area, but end the drag on its original position.

Browser version

Demo

@alexreardon
Copy link
Collaborator

Sounds good. Thankfully we are already making this change as part of #321

🎉

@alexreardon
Copy link
Collaborator

This shipped in 5.0

https://github.com/atlassian/react-beautiful-dnd/releases/tag/v5.0.0

🤩

@CrocoDillon
Copy link

I have a similar use-case where I want to delete items from a list if they are dragged outside of the droppable. Functionally it works... but briefly before the item is deleted it still animates back into its original position.

How did you solve this for your use-case?

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

No branches or pull requests

3 participants