RamonSmit/Nestable2

Removing or replacing element while preserving children

predaioan opened this issue · 1 comments

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?

I opened a pull request with the functionality you asked for