Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/actions/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
utils,
WorkspaceSvg,
keyboardNavigationController,
getFocusManager,
} from 'blockly';
import {Direction} from '../drag_direction';
import {Mover} from './mover';
Expand Down Expand Up @@ -43,6 +44,11 @@ export class MoveActions {
callback: (workspace) => {
keyboardNavigationController.setIsActive(true);
const startBlock = this.getCurrentBlock(workspace);
// Focus the start block in case one of its fields or a shadow block
// was focused when the move was triggered.
if (startBlock) {
getFocusManager().focusNode(startBlock);
}
return (
!!startBlock && this.mover.startMove(workspace, startBlock, null)
);
Expand Down Expand Up @@ -168,6 +174,11 @@ export class MoveActions {
const workspace = scope.block?.workspace as WorkspaceSvg | null;
if (!workspace) return false;
const startBlock = this.getCurrentBlock(workspace);
// Focus the start block in case one of its fields or a shadow block
// was focused when the move was triggered.
if (startBlock) {
getFocusManager().focusNode(startBlock);
}
return (
!!startBlock && this.mover.startMove(workspace, startBlock, null)
);
Expand Down
Loading