craft.js
craft.js copied to clipboard
listen add new element event
How I can listen add new element event? I'm building a feature which is trigger a modal after I drag to add a new element How to control that event?
I also need this kind of feature. Something like onElementAdded callback, I have tried onBeforeMoveEnd()
but it looks like only worked when dragging elements that have been already added to the Frame.
You can add a callback to connectors.create
:
connectors.create(ref, node, { onCreate: (nodeTree) => {
// nodeTree has been created
}});
You can add a callback to
connectors.create
:connectors.create(ref, node, { onCreate: (nodeTree) => { // nodeTree has been created }});
thank you @ankri! this is what I was looking for 🙌