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

<div> inside a .sortable-element doesn't work #5

Open
drhumlen opened this issue Oct 20, 2014 · 3 comments
Open

<div> inside a .sortable-element doesn't work #5

drhumlen opened this issue Oct 20, 2014 · 3 comments

Comments

@drhumlen
Copy link

If you look at my example, I've placed a <div> inside the sortable, which seems to break everything.
( demo: http://plnkr.co/edit/DfMGxmjCYYxdua8lYSQU?p=preview )

My code:

  <div ng-sortable="items">
    <div class="sortable-element" ng-repeat="item in items">
      <div ng-style="{backgroundColor: item.color}">
        {{item.name}}, {{item.profession}}
      </div>
    </div>
  </div>

The original:

  <div ng-sortable="items">
    <div class="sortable-element" ng-repeat="item in items" ng-style="{backgroundColor: item.color}">
      {{item.name}}, {{item.profession}}
    </div>
  </div>

Having another level of nesting, e.g. a <div>, inside a .sortable-element seems to break it. Do you have any idea why? I want to make a sortable list of more than just plain text. I can try to help (pull-request) if you can point me in a direction. Also, are you able to replicate the error? And lastly, is there a way around this / am I doing something wrong?

@natee
Copy link

natee commented Nov 10, 2014

@drhumlen
I have the same problem,maybe we can judge weather the trigger element's parents has a 'sortable-element' class before add a new class 'sortable-element-active'?

@schartier
Copy link
Owner

Sorry for the delay, I just updated index.html using inner div's but I was unable to reproduce the issue. My first guess, it's a css issue. If you find the exact problem it would be really nice from you to add a comment :)

@schartier
Copy link
Owner

I leave this thread open for anyone who could provide a better explanation.

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

3 participants