InsertAdjacentHTML('afterend', '<section></section>') . Is there any api like this in grapesjs ?
Question
Is there any way to add new section after the selected component using grapesjs ?
Answers (2)
You can do it in this way:
const cmp = editor.getSelected();
cmp.parent().append('<section>...</section>', { at: cmp.index() + 1 });
Thanks for reporting this, @iabhiyaan. Great question about FEAT: insertAdjacentHTML('afterend', '<section></section>') . Is there any api like this in grapesjs ?. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3422
How we can remove default text content from text component 'Insert your text here' ?
I want to remove default text from text component just like placeholder. every time when we drag text component we need to remove default t...
Issue #3683
How to set the component cannot be deleted
Issue #3346
Can I develop my own stylemanager and bind the properties conveniently?
I want to build my own stylemanager useing some UI framework like Element-UI to make a beauty UI quickly. But how can I bind the properties...
Issue #3233
Set Toolbar on every Component
Hi @artf Is there any standard way to add a new toolbar on every component I've tried this way When I run this code on the browser console...
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 βBrowse Plugin Categories
Jump directly to plugin category pages on the marketplace.