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 {
12
12
utils ,
13
13
WorkspaceSvg ,
14
14
keyboardNavigationController ,
15
+ getFocusManager ,
15
16
} from 'blockly' ;
16
17
import { Direction } from '../drag_direction' ;
17
18
import { Mover } from './mover' ;
@@ -43,6 +44,11 @@ export class MoveActions {
43
44
callback : ( workspace ) => {
44
45
keyboardNavigationController . setIsActive ( true ) ;
45
46
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
+ }
46
52
return (
47
53
! ! startBlock && this . mover . startMove ( workspace , startBlock , null )
48
54
) ;
@@ -168,6 +174,11 @@ export class MoveActions {
168
174
const workspace = scope . block ?. workspace as WorkspaceSvg | null ;
169
175
if ( ! workspace ) return false ;
170
176
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
+ }
171
182
return (
172
183
! ! startBlock && this . mover . startMove ( workspace , startBlock , null )
173
184
) ;
You can’t perform that action at this time.
0 commit comments