ngx-drag-and-drop-lists icon indicating copy to clipboard operation
ngx-drag-and-drop-lists copied to clipboard

DragOver

Open Twentyfoureyes opened this issue 7 years ago • 5 comments

Are you planning on implementing the dragOver? In the angularjs version of this library you could pass a function, which you could make return true or false, to stop the drag or not. That would be nice to have. Currently the dragOver event isn't emitted

Twentyfoureyes avatar Dec 14 '17 09:12 Twentyfoureyes

On the DndList there is dndDragOver event emitter. Is that what you are looking for?

misha130 avatar Dec 14 '17 10:12 misha130

Yes, but the event is not triggered, the code is commented out :)

Twentyfoureyes avatar Dec 14 '17 10:12 Twentyfoureyes

Well, thanks for notifying me :^) I'll check it and update

misha130 avatar Dec 14 '17 10:12 misha130

This doesn't seem to be working. Am I doing something wrong? To my understanding, this should prevent the drag from happening, but it is still happening.

@HostListener('dragover', ['$event'])
  dndDragOver(item, list) {
    return false;
}

chnakamura avatar Jul 13 '18 15:07 chnakamura

It looks like the source code for this callback is still commented out:

        // At this point we invoke the callback, which still can disallow the drop.
        // We can't do this earlier because we want to pass the index of the placeholder.
        // if (this.dndDragOver &&
        //     !this.invokeCallback(this.dndDragOver, event, dropEffect, itemType)) {
        //     return this.stopDragOver();
        // }

From https://github.com/misha130/ngx-drag-and-drop-lists/blob/master/src/directives/dnd-list.ts

kevinjsmith avatar Jul 24 '18 19:07 kevinjsmith

curious as to why the code that emits the dragOver event is still commented out?

Francisco-RP avatar Jun 27 '23 16:06 Francisco-RP