Keeping a toolbox sub-menus open after block selection

469 views
Skip to first unread message

Ben C

unread,
Jan 30, 2017, 9:30:06 AM1/30/17
to Blockly

Hi all

I've been poking around with the blockly toolbox menu recently, and I was wandering if there is a way for me to change one of the ways the toolboxs behaves. Here's a quick example:


When I select the 'logic' category it shows the sub menu of blocks as follows:
























When click and move the 'if' block, the sub menu containing the other blocks disappears:



















Is there a way to change how the 'logic' sub-menu behaves, so that it stays open until you click elsewhere in the workspace or select another category?  It would be nice to keep it open so that several blocks can be taken one after the other, without having to re-open the 'logic' category each time. 

Hopefully I've explained this in an understandable way.

Many thanks
Ben 

Rachel Fenichel

unread,
Feb 2, 2017, 5:28:45 PM2/2/17
to Blockly
Hi Ben,

There isn't a way to do that with current configuraiton options, though you may be able to get it to work by hacking around in toolbox.js or flyout.js.

Cheers,
Rachel

coldandtired

unread,
Mar 25, 2018, 6:06:25 PM3/25/18
to Blockly
I know it was a long time ago, but just in case anyone else is trying to do it you can do

workspace.toolbox_.flyout_.autoClose = false;

jarw...@gmail.com

unread,
Apr 16, 2018, 8:42:12 AM4/16/18
to Blockly

In iOS, I find WorkbenchViewController.toolboxDrawerStaysOpen  is effective when you set it true .I wish it`s helpful
在 2017年1月30日星期一 UTC+8下午10:30:06,Ben C写道:

Jessica Belicia Cahyono

unread,
May 23, 2025, 12:39:29 PMMay 23
to Blockly
Hi!

I know it's been a while,  but I am facing the exactly same issue with the post above.
I tried using workspace.getFlyout().autoClose = false; to avoid the flyout auto-close after dragging the block into the workspace and it worked for a while. However, since a couple of weeks ago it does not seem to work anymore.

It would be appreciated if anyone knows a way to keep the categorical toolbox flyout open.

Many thanks,
Jessica

Ben Henning

unread,
May 29, 2025, 6:52:15 PMMay 29
to Blockly
Hi,

The Flyout class actually has a specific function for this purpose: Flyout.setAutoClose(). It should behave roughly the same as what you used above, Jessica, though it has a bit of extra logic at the time auto close is disabled.

You mention that it's no longer working. Has anything else changed since it stopped working? For example, did you upgrade to Blockly v12? We would expect this function to work as documented, so additional context on why it isn't would be helpful.

Regards,
Ben

Reply all
Reply to author
Forward
0 new messages