File tree Expand file tree Collapse file tree
packages/blockly/core/dragging Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1238,6 +1238,19 @@ export class BlockDragStrategy implements IDragStrategy {
12381238 return this . pairToCandidate ( parentPair ) ;
12391239 }
12401240
1241+ // Fall back to the nearest parent block that has a compatible connection.
1242+ // This handles the case where a nested value block (e.g. a number input)
1243+ // has passive focus but the dragged block is a statement block that should
1244+ // be inserted after the containing statement block.
1245+ let parentBlock = passiveBlock . getSurroundParent ( ) ;
1246+ while ( parentBlock ) {
1247+ const pair = this . allConnectionPairs . find (
1248+ ( pair ) => pair . neighbour . getSourceBlock ( ) === parentBlock ,
1249+ ) ;
1250+ if ( pair ) return this . pairToCandidate ( pair ) ;
1251+ parentBlock = parentBlock . getSurroundParent ( ) ;
1252+ }
1253+
12411254 return null ;
12421255 }
12431256
You can’t perform that action at this time.
0 commit comments