Remove palette node after drop

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 =>
            .each((node: Node) => {
        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?

You might be interested in the “ExternalObjectsDropped” DiagramEvent listener in

Thanks I used the sample and in the palette I did work for me


I wonder why findNodeForKey return null,
Note that if I execute findNodeForKey before dragging it return the correct node.

Different keys in different models.

No they are the same keys, I did look at the nodeDataArray it is the same.
also I just drag the Item (even not drooping it) then call FindNodeForKey it does not find it.
before the drag operation it worked

Now I have another problem after dragging the items
I do open popup menu and select remove option.
in this case again the findNodeForKey returns null again.
so I can not delete the node.