[QUESTION][REQUEST] How to remove a block?
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()"?
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();
Blocks are those: https://grapesjs.com/docs/modules/Blocks.html
editor.DomComponents.getWrapper().getEl().insertAdjacentHTML(); you're not removing "blocks", you're dealing with native DOM elements there.
Probably you need to remove a Component, in that case use component.remove()