Remove all the blocks dragged by the user in Blockly

346 Views Asked by At

I am using Blockly library for a project. I want to remove all the blocks dragged by the user from the toolbox on pressing the reset button.

Can someone help with how can this be done. Which function do I have to use?

1

There are 1 best solutions below

0
On

This is implemented in Blockly by fa279b9. The user can do a context menu click on the workspace and select "Delete X Blocks" where X will be the number of blocks in the workspace:

context menu showing 'delete 2 blocks' in a blockly workspace with 2 blocks that have been dragged into the workspace