blockly-samples icon indicating copy to clipboard operation
blockly-samples copied to clipboard

Importing continuous-toolbox has side effects

Open janhink opened this issue 3 years ago • 4 comments

Description: I have my own Blockly workspace React component which has an attribute "isContinuous". When I set this to true, I would like to have the continuous toolbox displayed. When it's false, I would like to have a standard category toolbox.

The problem: Regardless if I use the continuous-toolbox plugin or not, importing "@blockly/continuous-toolbox" into my jsx file has side effects and my toolbox categories are rendered differently even when I don't use the plugin in the workspace configuration.

Expected behaviour: The toolbox categories should retain their standard visual representation even when I import "@blockly/continuous-toolbox" into the project.

janhink avatar Mar 17 '22 11:03 janhink

Someone else is also running into this problem. Here is the forum report: https://groups.google.com/g/blockly/c/Dw9zD6HBcT4/m/aq37KcNuAwAJ?utm_medium=email&utm_source=footer

Tagging for retriage.

BeksOmega avatar Sep 13 '23 16:09 BeksOmega

The next step is to narrow this down to figure out which part of the plugin is causing the side effects, so we can see how easy it would be to fix them.

rachel-fenichel avatar Sep 13 '23 21:09 rachel-fenichel

@johnnesky any interest in looking at this bug?

maribethb avatar Sep 27 '23 20:09 maribethb

I think this is due to the CSS being unconditionally registered: https://github.com/google/blockly-samples/blob/master/plugins/continuous-toolbox/src/ContinuousToolbox.js#L150-L169

With those rules applied, Blockly looks like this:

Screenshot 2023-10-03 at 3 13 36 PM

gonfunko avatar Oct 03 '23 22:10 gonfunko