Skip to content

Logic Comparison block doesn't immediately update when its children change outputs #757

@acbart

Description

@acbart

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.

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugDescribes why the code or behaviour is wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions