Removable if not last child #5513
Unanswered
acxvgalanov
asked this question in
Q&A
Replies: 1 comment
-
You can abort the remove editor.on('component:remove:before', (cmpToRemove, rm, opts) => {
if (cmpToRemove.parent().components().length < 2) {
opts.abort = true;
alert('Last component inside')
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Can I make a component removable only if it has siblings?
E.g. I have a container Row and it's children of type Column. Can I allow Columns to be removed unless this is the last Column left in a Row? So the Row always has at least one Column in it?
Beta Was this translation helpful? Give feedback.
All reactions