File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 utils ,
1313 WorkspaceSvg ,
1414 keyboardNavigationController ,
15+ getFocusManager ,
1516} from 'blockly' ;
1617import { Direction } from '../drag_direction' ;
1718import { Mover } from './mover' ;
@@ -43,6 +44,11 @@ export class MoveActions {
4344 callback : ( workspace ) => {
4445 keyboardNavigationController . setIsActive ( true ) ;
4546 const startBlock = this . getCurrentBlock ( workspace ) ;
47+ // Focus the start block in case one of its fields or a shadow block
48+ // was focused when the move was triggered.
49+ if ( startBlock ) {
50+ getFocusManager ( ) . focusNode ( startBlock ) ;
51+ }
4652 return (
4753 ! ! startBlock && this . mover . startMove ( workspace , startBlock , null )
4854 ) ;
@@ -168,6 +174,11 @@ export class MoveActions {
168174 const workspace = scope . block ?. workspace as WorkspaceSvg | null ;
169175 if ( ! workspace ) return false ;
170176 const startBlock = this . getCurrentBlock ( workspace ) ;
177+ // Focus the start block in case one of its fields or a shadow block
178+ // was focused when the move was triggered.
179+ if ( startBlock ) {
180+ getFocusManager ( ) . focusNode ( startBlock ) ;
181+ }
171182 return (
172183 ! ! startBlock && this . mover . startMove ( workspace , startBlock , null )
173184 ) ;
You can’t perform that action at this time.
0 commit comments