Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dropIndex is off if the target container is the mirror container #33

Closed
deje1011 opened this issue Nov 17, 2015 · 3 comments
Closed

dropIndex is off if the target container is the mirror container #33

deje1011 opened this issue Nov 17, 2015 · 3 comments

Comments

@deje1011
Copy link

In order to make nested css rules work while dragging, I use the drag/drop containers as mirror containers. That works fine, except for the dropIndex being off due to the fact that the mirror is still inside the target container when dropping the transit element. Possible fix:

function domIndexOf(child, parent) {
      /*
            If the mirror container is the target container itself, the mirror is still inside the target when
            dropping the transit element. Thats why we have to make sure to ignore the mirror element here. 
      */
      var children = angular.element(parent).children().not('.gu-mirror');
      return Array.prototype.indexOf.call(children, child);
  }

Thank you for this great plugin by the way!

@bevacqua
Copy link
Owner

Mirror container isn't supposed to be a dragula container.

@deje1011
Copy link
Author

Okay fair enough, it also leads to some other problems as I just noticed. Is there another way to keep nested css selectors working?
thanks for the quick response by the way

@bevacqua
Copy link
Owner

Sure, place the mirrors in a shared parent instead of directly inside the containers. Please use the slack support channel. See bevacqua/dragula#248

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants