Ryware / ngx-drag-and-drop-lists

Angular drag and drop component for lists
MIT License
49 stars 40 forks source link

DragOver #4

Closed Twentyfoureyes closed 1 year ago

Twentyfoureyes commented 6 years ago

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

misha130 commented 6 years ago

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

Twentyfoureyes commented 6 years ago

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

misha130 commented 6 years ago

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

chnakamura commented 6 years ago

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;
}
kevinjsmith commented 6 years ago

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

Francisco-RP commented 1 year ago

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