Invoke a digest cycle after the DOM changes, so that the next node is correctly focused on after a top-level block deletion.

This commit is contained in:
Sean Lip
2016-07-26 13:45:23 -07:00
parent 7ad1897deb
commit 8a9bae6587

View File

@@ -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 =