Hi, very nice plugin btw.
I'm using it on an Ember JS application for Drag & Drop dynamic div elements that reflects an Ember js object.
I face the problem that when taking the first element on the list for putting it as the last element, then the element was duplicated. I found out that your function for "reorder":
list.addEventListener('slip:reorder', function(e) {
// e.target list item reordered.
if (reorderedOK) {
e.target.parentNode.insertBefore(e.target, e.detail.insertBefore);
} else {
// element will fly back to original position
e.preventDefault();
}
});
when taking any element of the list to move it as last element, e.detail.insertBefore = null and it seems that insertBefore do not handle that situation properly, so I need it to implemented this way:
Hi, very nice plugin btw. I'm using it on an Ember JS application for Drag & Drop dynamic
div
elements that reflects an Ember js object. I face the problem that when taking the first element on the list for putting it as the last element, then the element was duplicated. I found out that your function for "reorder":when taking any element of the list to move it as last element,
e.detail.insertBefore = null
and it seems that insertBefore do not handle that situation properly, so I need it to implemented this way:don't know if it's the best approach but I think you should take a look at what is happening when
e.detail.insertBefore = null
. Best ;)