Skip to main content

Function: shadowBlockConversionChangeListener()

function shadowBlockConversionChangeListener(event): void;

Defined in: plugins/shadow-block-converter/src/shadow_block_converter.ts:319

Add this function to your workspace as a change listener to automatically convert shadow blocks to real blocks whenever the user edits a field on the block, like this:

workspace.addChangeListener(shadowBlockConversionChangeListener);

Ideally the Blockly.Field.prototype.setValue method should handle this logic, but for the purposes of this plugin it can be a workspace change listener.

Parameters​

ParameterTypeDescription
eventAbstractAn event broadcast by the workspace.

Returns​

void