Hiding toolbox results in trapped blocks

20 views
Skip to first unread message

Jing An Tew

unread,
Nov 5, 2025, 3:05:04 AM (yesterday) Nov 5
to Blockly
Hi, when hiding the toolbox programmatically through `.getToolbox().setVisible(false);`, the starting block gets trapped (it can't be dragged past the red line), this behavior disappears 
after blocks are added to the starting block, anyone know why this is the case?
Toolbox Shown

Block cannot be dragged past this invisible red line
Screenshot 2025-11-05 160326.png
When blocks are attached, no issue dragging them past the toolbox, removing that block brings the issue back.

Jing An Tew

unread,
Nov 5, 2025, 3:09:58 AM (yesterday) Nov 5
to Blockly
Screenshot 2025-11-05 143620.png
Toolbox Shown

Screenshot 2025-11-05 143702.png
Invisible Red line blocking it from being dragged into the hidden toolbox space

Taurus Rico

unread,
Nov 5, 2025, 9:02:47 AM (yesterday) Nov 5
to Blockly
Hi, I think the workspace is not used to it's new dimensions.
Whenever you set the Toolbox to invisible and also visible you can call Blockly.svgResize(workspace); 
Then the workspace calculates it's new dimensions to fill the container space completely.

Greetings, Rico

Jing An Tew

unread,
Nov 5, 2025, 10:29:55 AM (23 hours ago) Nov 5
to Blockly
Hi Rico,
Thanks a lot, that seems to have solved the issue. 
Reply all
Reply to author
Forward
0 new messages