Created
February 23, 2021 12:04
-
-
Save prappo/b2b303545a0e01875028d546af1e5ecb to your computer and use it in GitHub Desktop.
Grapesjs Search blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bm = editor.BlockManager; | |
var blocks = bm.getAll(); | |
bm.render(blocks.filter( | |
block => { | |
let blockName = block.attributes.label; | |
return blockName.toLowerCase().includes(text); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment