Toogle Toolbox visibility/display. Is it possible?

45 views
Skip to first unread message

Christoph Griehl

unread,
May 6, 2021, 5:14:45 AM5/6/21
to Blockly

Hello everbody,
First of all, thanks for this great library.
I am currently trying to toggle the toolbox to give the user more space if he wishes since Blockly only occupies 2/3 of a tablet.
I tried it with myToolbox.setVisibility(false) then it is gone but you can still drag blocks on the toolbox and remove them therefore. Personally I would consider this sub-optimal since its pretty unexpected and you get something you cant see.

I wanted to do myToolbox.dispose() but I could not find a method to set a new toolbox on an existing workspace.

I tried worspace.updateToolbox(). It throws if I provide an empty toolbox or something similar. Am I using it wrong?

My goal is to toggle the appearance of the toolbox without injecting again. But I dont want this weird side-effect like with setVisibility()

Abby Schmiedt

unread,
May 6, 2021, 11:40:49 AM5/6/21
to Blockly
Hello!

Thanks for the question. The behavior you are seeing with setVisible is definitely a bug and I have files an issue on github. I plan on fixing this by next release at the end of June, however if you need a fix before then I have created a code sandbox with a custom toolbox that will fix this issue. You would include this toolbox for now and then when you update to the latest release you could remove it. 

Sorry for the inconvenience. Let me know if you have any problems with the example I sent or any other questions!

Cheers,
Abby
Reply all
Reply to author
Forward
0 new messages