marceljuenemann / angular-drag-and-drop-lists

Angular directives for sorting nested lists using the HTML5 Drag & Drop API
MIT License
2.16k stars 713 forks source link

figuring out the solution for it. Help me out. #472

Open harsee4all opened 6 years ago

harsee4all commented 6 years ago

I have 2 separate list in one page and both have this drag and drop features use mostly for re ordering the items.
how I can make both list separate completely as in item A from List 1 should not able to drop in List 2 and vice versa?

BusbyActual commented 6 years ago

According to the documentation this isn't currently supported. At first glance you can solve this by changing the callback in the dragover event handler. ` element.on('dragover', function(event) { event = event.originalEvent || event;

    // Check whether the drop is allowed and determine mime type.
    var mimeType = getMimeType(event.dataTransfer.types);
    var itemType = getItemType(mimeType);
   // commenting this line out causes drag events to not resolve. You'll need to add some code to change how this works. 
   // if (!mimeType || !isDropAllowed(itemType)) return true;

`