How to remove a block?
You touched on a few questions here, but to get to your first in your headline; reference the BlockManager api docs here e.g.
Read full answer below ↓Question
editor.DomComponents.getWrapper().getEl().insertAdjacentHTML('beforeBegin', letBlock)
letBlock letblock is a variable that contains HTML.
Question:
- How to remove this adjacent HTML?
- is there a function like "insertAdjacentCSS()"?
Answers (3)
You touched on a few questions here, but to get to your first in your headline; reference the BlockManager api docs here
e.g. BlockManager.remove('custom-block-id')
You're mixing too much stuff in one question and without any context
@artf I just wanted to remove the new block that I added via
editor.DomComponents.getWrapper().getEl().insertAdjacentHTML();
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1895
[QUESTION] Drag component over canvas with script, script appended multiple times.
Hi, not sure if this is a bug or not. But I noticed a weird behavior, when I drag a block that has a component that contains a script funct...
Issue #1670
Adding default Layout in grapejs
When I open the grapejs editor for the first time it appears as white-board. I need to add default HTML layout (columns) like in this photo...
Issue #1628
custom tool deleting issue
After deleting custom tool ( from html editor ) that contain html with Js code , the code still in the grapes editor , how i can remove it ?
Issue #2120
CSS properties of body (#wrapper) not editable after editor.setComponents(html);
When I save my page in a database refresh, the html and css are set like so $.ajax({ url: "../feeder.php", type: 'POST', processData: false...
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.