Hi contributers,
canceling the dropping from within my code doesnt work because my code is waiting for a promise to resolve or reject.
So I added:
item['initialSibling']=_initialSibling to the drop method. Now I can insert the element at it origin:
const promise = new Promise ((resolve, reject) => {
doTheDrop (el, target, source, sibling, workflow);
});
promise.then( (data) => {
//great drop is ok
}, (reason) => {
// Rejected!
source.insertBefore ( el, el.initialSibling == undefined ? null : el.initialSibling );
});
However, I would rather not change dragula.js. Is it possible to access this property some other way?