File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 66
77import {
88 ASTNode ,
9+ BlockSvg ,
910 RenderedConnection ,
1011 ShortcutRegistry ,
1112 utils as BlocklyUtils ,
@@ -92,6 +93,19 @@ export class DisconnectAction {
9293 let curNode : ASTNode | null = cursor . getCurNode ( ) ;
9394 let wasVisitingConnection = true ;
9495 while ( curNode && ! curNode . isConnection ( ) ) {
96+ const location = curNode . getLocation ( ) ;
97+ if ( location instanceof BlockSvg ) {
98+ const previous = location . previousConnection ;
99+ const output = location . outputConnection ;
100+ if ( previous ?. isConnected ( ) ) {
101+ curNode = ASTNode . createConnectionNode ( previous ) ;
102+ break ;
103+ } else if ( output ?. isConnected ( ) ) {
104+ curNode = ASTNode . createConnectionNode ( output ) ;
105+ break ;
106+ }
107+ }
108+
95109 curNode = curNode . out ( ) ;
96110 wasVisitingConnection = false ;
97111 }
You can’t perform that action at this time.
0 commit comments