Skip to content

disable blockly orphan connection logic#11201

Merged
riknoll merged 1 commit intomasterfrom
dev/riknoll/arcade-disable-orphan-connection-behavior
Mar 19, 2026
Merged

disable blockly orphan connection logic#11201
riknoll merged 1 commit intomasterfrom
dev/riknoll/arcade-disable-orphan-connection-behavior

Conversation

@riknoll
Copy link
Member

@riknoll riknoll commented Mar 19, 2026

fixes microsoft/pxt-arcade#7370

also mentioned on the forum here: https://forum.makecode.com/t/list-variable-persists-when-covered-with-another-block/42747

not that i actually needed this to be reported, because it annoys me ALL THE TIME, but i never fixed it because this isn't actually a bug but rather an intentional blockly feature.

when a block is dragged into an input that already has a non-shadow block connected, blockly has some logic that checks to see if the block you just dragged has a single input and, if so, connects the previously connected block to the input of the block you just dragged. presumably this is to make it easier to wrap blocks with a new block (for example, dragging an absolute value block onto a number in an equation will wrap it theoretically saving you an extra drag). however, nobody ever expects this behavior and only the most powerful of power users would use it to their advantage. it also can cause type errors when the displaced block is a variable since variables can be connected to any input regardless of what type they actually hold. it's better to just disable it entirely.

behavior before:
orphan_block_before

behavior after:
orphan_block_after

unfortunately, there's no graceful way to disable this so i had to monkey patch

if you want to look at the original code that's being patched, it's here

@riknoll riknoll requested a review from a team March 19, 2026 00:31
@Jaqster
Copy link
Member

Jaqster commented Mar 19, 2026

Oh wow, I never noticed this blockly "feature" before... very un-intuitive. I can see container blocks wrapping around existing blocks, but not for inputs/inline blocks. Thanks for making this change Richard. I wonder if we should also give Blockly some feedback on this?

@riknoll riknoll merged commit 8c30cda into master Mar 19, 2026
20 checks passed
@riknoll riknoll deleted the dev/riknoll/arcade-disable-orphan-connection-behavior branch March 19, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For element loop - default list array replacing tile shadow block

3 participants