Delete a Top-level node #702
-
I need to delete a top-level node but the deletion feature works only with nested nodes. The challenge here is when building a section architecture where you can delete everything inside the section, but the section is still in the dom, which is a problem. It will be amazing to be able to delete a top-level node just like any other node as it's not the root node. I read the docs and couldn't find a solution, if you know any solution please let me know.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'm building a large page-builder app and i'll have some base components and some composed components(which will be composed by using those base components) and i'm facing the exact issue. To avoid this i had to add an extra div but it seems redundant and complicates stuff. Is there smth that i'm not understanding about craft js? @prevwong thank u for Craft.js :) |
Beta Was this translation helpful? Give feedback.
-
Yeah I agree, just need to replace this line with preventing the consumer from deleting the ROOT_NODE instead 🤔 |
Beta Was this translation helpful? Give feedback.
Yeah I agree, just need to replace this line with preventing the consumer from deleting the ROOT_NODE instead 🤔