Open Liujianfu opened 9 years ago
Me to posted the same kind of issue https://github.com/a5hik/ng-sortable/issues/202
I had a similar issue and I'm not sure if this is 100% related but i changed the .as-sortable-drag class in ng-sortable.style.css to
.as-sortable-drag {
position: fixed;
opacity: .8;
}
Now the draggable element sticks to the cursor.
Sorry Michael. This solution is not working.
By default if the draggable elements are only in the view port then dragging is working perfectly.
Root cause: If we have the draggable elements overflowing the viewport, then this is not working as expected.
Are you using Bootstrap? I had faced a similar issue with the positioning of the item. this was my code snippet:
$scope.sortableOptions = {
containment: "#sort_" +index+ "",
scrollableContainer: "#sort_" +index+ "",
containerPositioning: 'relative',
accept: function (sourceItemHandleScope, destSortableScope) {
return sourceItemHandleScope.itemScope.sortableScope.$id === destSortableScope.$id;
}
};
As mentioned in the documentation, after using containerPositioning
option and setting it to relative
, the issue got resolved.
If still you're facing a problem, could you send a code snippet and elaborate a little more.
@SakshiParakh Set containerPositioning: 'relative'
, this is perfect.
Hi, any piece of advice for this issue when using Angular Material grid layout? containment
+ containerPositioning
didn't help here...
Thanks.
I'm finding that containment + containerPositioning does give the dragging element a top position that's a consistent distance from the original element, regardless of how far down the page the element is. However, the dragging element is not positioned correctly with respect to the original (several pixels to the left, perhaps 50-70 too high). Is there a configuration option to deal with this?
I had this problem while using Bootstrap 3, what caused it was lack of "row" elements.
Hey can you elaborate what you mean by lack of "row" elements? I'm facing the issue as well. @simvol
Sometimes the container's height is 0 if I use Body as the containment, so the dragelement's position is incorrect. I cannot find the root cause.