Hidden statement inputs seem broken
See original GitHub issueProblem
If I attach a block to a hidden statement input (reasonably expecting that block to be hidden), the block is programmatically attached to the input, but shown free-floating on the workspace.
Expected behavior
The “visible” flag of the input should cascade down to anything attached to it.
Actual Behavior
Actual behavior is basically “Weird”.
I can verify programmatically that the block is attached to the input, but visually it just appears near the block with the input on the work-space and I drag it around free-form.
This makes hiding a statement input somewhat futile.
Steps to reproduce
I have code like this:
const summaryInput = this.appendStatementInput("summaryCollection");
summaryInput.setVisible(false);
summaryInput.connection.connect(blockToAttach.previousConnection);
blockToAttach ends up showing detached on the workspace (even though it is in fact attached in the block model).
Workaround
As I can’t see a way of hiding a block (looking at the Block API), I’m not sure what the workaround is.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
«Paraphrasing myself from #1968»
I don’t think
Input.setVisible(..)
should have been public method. That said, I think we can fix the actual issue so it behaves correctly without expecting extra call from the app developer. I expect it is still an issue if a app developer connects/disconnects to a collapsed block (but I haven’t tested this).Reopening, but marking it low priority since it is not visible in the UI (requires specific API calls to trigger).
Fixed by #3806