FEAT: 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 (1)
You can do it in this way:
const cmp = editor.getSelected();
cmp.parent().append('<section>...</section>', { at: cmp.index() + 1 });
Related Questions and Answers
Continue research with similar issue discussions.
Issue #553
Adding new components to existing ones
Hello, I would like to ask if there's any existing support or API for adding new components to an existing component list (e. g. after fetc...
Issue #2076
[QUESTION] How make a new component to allow laravel blade directives?
Hi, thanks for the nice work. I'll like to know if there is a way to use blade directives inside the code. I already add a new functionalit...
Issue #2770
[QUESTION] Set selected element
Hello, is there a way to select an element after added to the body? When i add a link, i want to open the Component Settings immediately. H...
Issue #501
Add custom CSS rule
Hi! I would like to add a CSS rule that, for instance, changes appearance of a component based on some attribute. I.e. Is there a way of do...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.