From 8a9bae6587a32c32f2013813c00624a7964554cf Mon Sep 17 00:00:00 2001 From: Sean Lip Date: Tue, 26 Jul 2016 13:45:23 -0700 Subject: [PATCH] Invoke a digest cycle after the DOM changes, so that the next node is correctly focused on after a top-level block deletion. --- 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 d36bde6e2..50412a830 100644 --- a/accessible/workspace-tree.component.js +++ b/accessible/workspace-tree.component.js @@ -122,7 +122,10 @@ blocklyApp.WorkspaceTreeComponent = ng.core this.treeService.clearActiveDesc(this.tree.id); deleteBlockFunc(); - nextNodeToFocusOn.focus(); + // Invoke a digest cycle, so that the DOM settles. + setTimeout(function() { + nextNodeToFocusOn.focus(); + }); } else { var blockRootNode = document.getElementById(this.idMap['blockRoot']); var nextActiveDesc =