diff --git a/accessible/clipboard.service.js b/accessible/clipboard.service.js index 6048e1c2c..246d9a2af 100644 --- a/accessible/clipboard.service.js +++ b/accessible/clipboard.service.js @@ -115,6 +115,7 @@ blocklyApp.ClipboardService = ng.core alert( Blockly.Msg.PASTED_BLOCK_FROM_CLIPBOARD_MSG + reconstitutedBlock.toString()); + return reconstitutedBlock.id; }, pasteToMarkedConnection: function(block) { var xml = Blockly.Xml.blockToDom(block); diff --git a/accessible/workspace-tree.component.js b/accessible/workspace-tree.component.js index 1d42d6a43..6c11b0c47 100644 --- a/accessible/workspace-tree.component.js +++ b/accessible/workspace-tree.component.js @@ -157,13 +157,18 @@ blocklyApp.WorkspaceTreeComponent = ng.core // If the connection is a 'previousConnection' and that connection is // already joined to something, use the 'nextConnection' of the // previous block instead in order to do an insertion. + var newBlockId = null; + if (connection.type == Blockly.PREVIOUS_STATEMENT && connection.isConnected()) { - that.clipboardService.pasteFromClipboard( + newBlockId = that.clipboardService.pasteFromClipboard( connection.targetConnection); } else { - that.clipboardService.pasteFromClipboard(connection); + newBlockId = that.clipboardService.pasteFromClipboard(connection); } + + // Move the screenreader focus to the newly-pasted block. + that.treeService.setActiveDesc(newBlockId + 'blockRoot', that.tree.id); }, this.tree.id); }, moveToMarkedSpot_: function() {