fatlinesofcode / ngDraggable

Drag and drop module for Angular JS
MIT License
630 stars 400 forks source link

ng-drop-success callback doesn't fire for two different elements from the same scope #174

Closed smartapant closed 9 years ago

smartapant commented 9 years ago

When two different elements with ng-drag and ng-drop attributes are in the same scope ng-drop-success callback doesn't fire.

I've found out that it is caused by identifying drag and drop elements by scope id (var _myid = scope.$id). So, the drop element listens to onDragEnd event and then checks the id of the elements:

if (!_dropEnabled || _myid === obj.uid) {
    updateDragStyles(false, obj.element);
    return;
}

Two different elements from the same scope are identified as one, onDragEnd handler exits, ng-drop-success callback never gets fired.

smartapant commented 9 years ago

https://github.com/fatlinesofcode/ngDraggable/issues/117