File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -533,6 +533,21 @@ export class RenderedConnection extends Connection {
533533 childBlock . updateDisabled ( ) ;
534534 childBlock . queueRender ( ) ;
535535
536+ // If either block being connected was selected, visually un- and reselect
537+ // it. This has the effect of moving the selection path to the end of the
538+ // list of child nodes in the DOM. Since SVG z-order is determined by node
539+ // order in the DOM, this works around an issue where the selection outline
540+ // path could be partially obscured by a new block inserted after it in the
541+ // DOM.
542+ const selection = common . getSelected ( ) ;
543+ const selectedBlock =
544+ ( selection === parentBlock && parentBlock ) ||
545+ ( selection === childBlock && childBlock ) ;
546+ if ( selectedBlock ) {
547+ selectedBlock . removeSelect ( ) ;
548+ selectedBlock . addSelect ( ) ;
549+ }
550+
536551 // The input the child block is connected to (if any).
537552 const parentInput = parentBlock . getInputWithBlock ( childBlock ) ;
538553 if ( parentInput ) {
You can’t perform that action at this time.
0 commit comments