touch-dnd icon indicating copy to clipboard operation
touch-dnd copied to clipboard

Delete Item when dragged away from draggables?

Open christianmagill opened this issue 8 years ago • 3 comments

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?

christianmagill avatar Jun 01 '16 04:06 christianmagill

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.

rkusa avatar Jun 01 '16 06:06 rkusa

Thanks,

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

christianmagill avatar Jun 01 '16 17:06 christianmagill

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.

christianmagill avatar Jun 01 '16 23:06 christianmagill