Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Delete Item when dragged away from draggables? #63

Open
christianmagill opened this issue Jun 1, 2016 · 3 comments
Open

Delete Item when dragged away from draggables? #63

christianmagill opened this issue Jun 1, 2016 · 3 comments

Comments

@christianmagill
Copy link

I have a grid of droppables that the user can drag items into. I'd like to allow those items to be deleted by dragging items away from the grid. It seems the default is to return the item to it's previous droppable.

Any suggestions?

@rkusa
Copy link
Owner

rkusa commented Jun 1, 2016

I have never tried to implement this behavior, but maybe you are able to implement it in the draggable:stop event. However, you would have to check whether the draggable has been stopped outside or not on your own.

@christianmagill
Copy link
Author

Thanks,

I ended up using https://github.com/yckart/jquery.overlaps.js

@christianmagill
Copy link
Author

christianmagill commented Jun 1, 2016

Turns out I jumped the gun on this. Can't seem to find anything that consistently gives me correct final positioning of the dragged item. I've tried offset and getBoundingClientRect, both can return results that are completely off screen even when the item is dropped within the grid.

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

No branches or pull requests

2 participants