Fixed to work with deep descendants by yenoh2 · Pull Request #494 · angular-ui/ui-sortable (original) (raw)

In trying to use ui-sortable with Angular Material tabs, I found that it didn't work for two reasons. First you can't have two directives with an isolated scope on the same element. Second, ui-sortable didn't support items that aren't a direct decendant. I modified the "getElementScope" function to get the applicable scope for the draggable item, if the normal code results in null. I also wrapped the md-tabs directive in a div containing the ui-sortable directive to circumvent the two directives with isolated scopes issues.

As far as I can tell, this works. Can you see any issues with my change?

See the following example:
http://codepen.io/yenoh2/pen/rWxxVJ

This seems to be related to "Using ui.sortable with angular ui.bootstrap.tabs have a weird interaction #248"