Check empty element
Question
Hi @artf,
Hope you are doing fine,
I want to check when section element is empty like i drag a empty section and then inside that i drag h1 or column element.After that how i check when user delete all the elements from the section element.
Overall theory is how i check that the particular element is empty.
Answers (2)
if (model.components().length === 0 && !model.get('contents')) {
// is empty
}
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1111
How to add parent class when drag element
Hi @artf, Hope you are doing fine. Please let us know how we can add the parent class of div when new element is dragged inside that div li...
Issue #1090
How to remove toolbar icons
Hi artf, Please let me know how we can remove the toolbar icons like when user click on image element then I don't want delete icon or othe...
Issue #1748
How to prevent drag items inside the editor
Hello @artf You are doing great job with grapesjs and it's extremely helpful to make our functionality more user friendly. Thanks for creat...
Issue #1789
[Question] How to append a plus icon in the column and element section?
Hi @artf . First of all, great work. I have been trying to use grapesjs for a month now. So, I stumbled upon a situation where I need to le...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.