RamonSmit / Nestable2

New pickup of Nestable!
Other
322 stars 147 forks source link

Removing or replacing element while preserving children #105

Open predaioan opened 6 years ago

predaioan commented 6 years ago

Currently, from what I see, removing an element with children will delete the item together with all its children.

This behavior is counter intuitive in many real life scenarios where removing the parent would allow the children to "move one level up" to the removed element's level (that is becoming children of the removed element's parent or the root if that's the case) . For example:

Element 1
    Child 1.1
    Child 2.1
Element 2

after removinv Element 1 would need to turn into:

FormerChild 1.1
FormerChild 2.1
Element 2

Did anyone address this or has seen an example solution somehwere?

mrgingles commented 6 years ago

I opened a pull request with the functionality you asked for