alyssaxuu / flowy

The minimal javascript library to create flowcharts ✨
MIT License
11.48k stars 998 forks source link

Can't attach rearrange event when move to new position #78

Closed anhtu-phan closed 4 years ago

anhtu-phan commented 4 years ago

Thank you for your library I have reArranging function like below flowy(document.getElementById("canvas"), drag, release, snapping, reArranging); function reArranging(block, parent) { // When a block is rearranged console.log("REARANGE BLOCK", block); console.log("REARANGE PARENT", parent); } When I move block to another position (not associated with any existed blocks in canvas) -> two line in function above is executed. But when I move block with associating with existed blocks in canvas -> two lines in function is not executed.

My problem is that I need to get block and its new parent when rearranging block.

Please help me to solve this. thank you

alyssaxuu commented 4 years ago

So as I understand it, your issue is that the rearrange function doesn't get called when some blocks from the canvas are rearranged and then snapped back to a different parent? In that case, the snap function should do the job.