From 6d14be9d914f9d5cebf66b0916e2d9bc14cf4862 Mon Sep 17 00:00:00 2001 From: Sean Lip Date: Tue, 26 Jul 2016 13:56:46 -0700 Subject: [PATCH] Always remove screenreader focus from block before pasting to one of its connections. --- accessible/workspace-tree.component.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/accessible/workspace-tree.component.js b/accessible/workspace-tree.component.js index 50412a830..f0a9401dc 100644 --- a/accessible/workspace-tree.component.js +++ b/accessible/workspace-tree.component.js @@ -158,6 +158,8 @@ blocklyApp.WorkspaceTreeComponent = ng.core // screenreader focus for the destination tree to the block just moved. var newBlockId = null; + this.treeService.clearActiveDesc(this.tree.id); + // 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. @@ -172,8 +174,9 @@ blocklyApp.WorkspaceTreeComponent = ng.core // Invoke a digest cycle, so that the DOM settles. var that = this; setTimeout(function() { + // Move the focus to the current tree. + document.getElementById(that.tree.id).focus(); // Move the screenreader focus to the newly-pasted block. - that.treeService.clearActiveDesc(that.tree.id); that.treeService.setActiveDesc(newBlockId + 'blockRoot', that.tree.id); }); },