I am using primeng p-tree component and i would like to forbid some node type to be drop inside another node type.
for exemple i have node with type folder and another node with type file and i only want that node of type file move inside a node of type folder. I want to forbid moving folder node inside another folder node. (and other rules
<p-tree [value]="filesTree7" draggableNodes="true" droppableNodes="true" dragdropScope="files" selectionMode="single" [(selection)]="selectedFile2" [contextMenu]="cm" (contextmenu)="onContextMenu($event)"
(onNodeDrop)="onNodeDrop($event)"></p-tree>
I tried to stop propagation of the drop like this :
onNodeDrop(event) {
console.log("onNodeDrop");
event.originalEvent.stopPropagation();
event.originalEvent.preventDefault();
return;
}
but it is not working.
when i have a look to primeng code here : primeng tree component code source it seems that onNodeDrop event is emit too late.
Do you have any ideas how i can implement what i need ?