angular-ui / ui-sortable

jQuery UI Sortable for AngularJS
http://angular-ui.github.io/ui-sortable/
MIT License
1.26k stars 443 forks source link

Sortable UI is "blocking" any drag-* events? #473

Closed vitozev closed 8 years ago

vitozev commented 8 years ago

I have the following piece of code (codebase which can't be modified atm):

 <ul ui-sortable ng-model="list">
    <!-- onDragStartHandler() is a global function, not part of $scope -->
    <li draggable ondragstart="onDragStartHandler();" ng-repeat="item in list">Item: {{item}}</li>
  </ul>

When ui-sortable directive is being used, all ondrag* events are not fired at all, it seems that after initialization, the event listeners are removed from DOM.

I know that using $sortableOptions, I'm able to execute some code at specific action, the problem is that we're using DataTransfer object (part of Drag and Drop HTML5 API), which doesn't exists in MouseEvents.

Plnkr: http://plnkr.co/edit/OOw8Rt2jeo0qbqeE7Iqy?p=preview

Any suggestions?

thgreasi commented 8 years ago

Unfortunately, that's in the jquery-ui part, which handles the mouse events and prevents them from bubbling. To exact, jquery-ui emulates the drag and the HTML5 Drag&Drop API isn't used at all. It just places the elements below your mouse pointer. PS: the plnkr that you shared has nothing inside the . Is it supposed to be that way?