craft.js icon indicating copy to clipboard operation
craft.js copied to clipboard

Drop Component Positon

Open Abhisheknanda1344463 opened this issue 3 years ago • 3 comments

Hi, Is there any way to determine that we are dropping a component on which Element and get a callback or something into to be dropped component to get its id or type?

Abhisheknanda1344463 avatar Jun 12 '21 17:06 Abhisheknanda1344463

@prevwong Could you please help me here? Thanks

Abhisheknanda1344463 avatar Jun 16 '21 08:06 Abhisheknanda1344463

Maybe so late but, are you tried with the rules properties? I think is what you need https://craft.js.org/r/docs/concepts/user-components#specify-dragdrop-rules in the Node api you can see posible values for rules https://craft.js.org/r/docs/api/node

pepas24 avatar Aug 30 '21 12:08 pepas24

With #188 we added a callback that returns the dropped node. You could get the parent via that and with that have access to the node which the newly created node has been dropped into.

ankri avatar Aug 30 '21 12:08 ankri