Hi,
I want to prevent a card being dropped on itself - when dropping on other lists I use OnListBeforeDragIn, OnListBeforeDrop to control this and it is fine but when a card is dropped on itself the click event still fires (even though I return false in OnListBeforeDragIn)
My problem is that I also use OnListItemClick so on releasing the mouse after a drag to itself triggers the click event for the card - any ideas?
It’s a normal behavior, as the pointer is released in the same area. However, if you need to omit such behavior, you can use preventDefault
as follows:
kanban.attachEvent("onlistbeforedrop", function(context, e){
e.preventDefault();
return false;
});
There seems to be a bug when dropping a card in itself. The code below works fine if droppoing on another node but if dropping on itself then the click still fires:
function OnListBeforeDrop(context,ev,list){
ev.preventDefault();
return false;
}
function OnListBeforeDragIn(dragContext,e,list){
There seems to be a bug when dropping a card in itself. The code below works fine if dropping on another node but if dropping on itself then the click still fires:
function OnListBeforeDrop(context,ev,list){
ev.preventDefault();
return false;
}
function OnListBeforeDragIn(dragContext,e,list){
return true;
}
function OnListItemClick(itemId,ev,node,list){
alert('clicked');
};
We’ll look into this behavior. As a quick (yet temporary) solution, I suggest you block the dropping from the list, as the related event fires earlier for it:
$$("$kanbanlist2").attachEvent("onbeforedrop", function(context){
return false
});