question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Block API remove function

See original GitHub issue

I would assume that the remove() function would be required in such project, there’s adding, getting, but not removing selected block, I would like to remove button block, and add my own - so I can make my own styles for it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
artfcommented, Aug 2, 2017

Agree, I’ll add it soon, for the moment you can use this editor.BlockManager.getAll().remove('block-id')

1reaction
artfcommented, Nov 17, 2017

@Geczy probably something like this

const bm = editor.BlockManager;
const blocks = bm.getAll();
const toRemove = blocks.filter(block => block.get('category') === ...);
toRemove.forEach(block => bm.remove(block.get('id')))
Read more comments on GitHub >

github_iconTop Results From Across the Web

Element.remove() - Web APIs - MDN Web Docs
The Element.remove() method removes the element from the DOM.
Read more >
.remove() | jQuery API Documentation
A selector expression that filters the set of matched elements to be removed. Similar to .empty() , the .remove() method takes elements out...
Read more >
How to block delete api - Auth0 Community
Click the APIs tab for that app. Next to the management API is a down arrow, click that to expand the permissions. Remove...
Read more >
Supports | Block Editor Handbook
Block Supports is the API that allows a block to declare support for certain features. ... supports: { // Remove the support for...
Read more >
Delete a block - Notion API
To restore the block with the API, use the Update a block or Update page respectively.. Integration capabilities. This endpoint requires an integration...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found