-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
So, perhaps this is the expected behavior, but I think there's a minor issue with setOutput when it comes to logic_compare blocks.
So say I have a "logic_compare" between a literal number and a variable.
And I run some bit of code to change the output type of the variable:
Blockly.mainWorkspace.getAllBlocks()[2].setOutput(true, "Array")
In theory, the blocks should be bounced out of the conditional, since they're both wrong (I'd rather only one bounce out, but this is fine too). This is what happens with simpler checks, e.g., if I change a "variables_get" block inside of a "control_repeat" block (which expects a "Number" output). However, nothing happens UNTIL I click one of the blocks in question, at which time the separation occurs.
I assume this happens because the onchange() function for the "logic_compare" block doesn't get triggered by a setOutput() call. If this is normal behavior, I'd be very interested if there's a way to sanely force this kind of update. I was hoping workspace.render would do it, but it didn't seem to make a difference.
