I try to use ng-sortable in my angular project, but i meet some problems ...
Indeed, I have a list of cards that i want to drag and drop. With ng-sortable I manage to drag and drop my card, however when I do it ng-sortable add the class as-sortable-hidden which hide my card.
How can I avoid that my card is hidden and to have a comportment like the demo below :
http://a5hik.github.io/ng-sortable/#/block
Here my html code :
<div as-sortable="dragControlListeners" data-ng-model="titres" id="sortlist" scroll="false">
<div as-sortable-item class="as-sortable-item" ng-repeat="titre in titres">
<div as-sortable-item-handle class="as-sortable-item-handle" ng-show="kpi.activeKPI[$index] != 0">
<!-- content of one card -->
</div>
</div>
</div>
A bit late but it might help someone stuck in a similar case. I had the same issue and it was a styling conflict with my app's styling.
Here is what I did:
Add these to the
.as-sortable-dragclass (define the class somewhere if it doesn't exist and use !important if necessary):Here is my HTML structure:
What helped me understand the issue was Chrome's DOM breakpoints. Juste put one on the
<ul>and you will be able to inspect the<ul>element that is appended to<body>when dragging.