is there a sample that removes node from a palette after it was dropped on a diagram?
I tried to do something like that
on the diagram
onExternalObjectsDropped = (event: DiagramEvent) => {
let stateRolesAdded = [] as StateRole[];
(event.subject || [])
//.filter(node => node.data)
.each((node: Node) => {
stateRolesAdded.push(node.data);
});
NOTIFY DROP succedded;
}
then on the palette I get the event that drop succeded
this.palette.commit(() => {
stateRoles.forEach(stateRole => {
const nodeToDelete = this.palette.findNodeForKey(id);
});
I turns out that the nodeToDelete is null.
Note that If I look at the palette model nodedataArray I do see the data
it looks like the dragging is causing a problem to the model
am I doing something wrong?
is there a sample that I can look at to solve this?