diff --git a/accessible/sidebar.component.js b/accessible/sidebar.component.js index f3e2f14b2..832f041d4 100644 --- a/accessible/sidebar.component.js +++ b/accessible/sidebar.component.js @@ -90,7 +90,11 @@ blocklyApp.SidebarComponent = ng.core.Component({ }, clearWorkspace: function() { blocklyApp.workspace.clear(); - document.getElementById(this.ID_FOR_CREATE_NEW_GROUP_BUTTON).focus(); + // The timeout is needed in order to give the blocks time to be cleared + // from the workspace, and for the 'workspace is empty' button to show up. + setTimeout(function() { + document.getElementById(blocklyApp.ID_FOR_EMPTY_WORKSPACE_BTN).focus(); + }, 50); }, showToolboxModalForAttachToMarkedConnection: function() { this.toolboxModalService.showToolboxModalForAttachToMarkedConnection( diff --git a/accessible/utils.service.js b/accessible/utils.service.js index e6adbf5af..98316106e 100644 --- a/accessible/utils.service.js +++ b/accessible/utils.service.js @@ -26,6 +26,7 @@ */ var blocklyApp = {}; +blocklyApp.ID_FOR_EMPTY_WORKSPACE_BTN = 'blocklyEmptyWorkspaceBtn'; blocklyApp.UtilsService = ng.core.Class({ constructor: [function() {}], diff --git a/accessible/workspace.component.js b/accessible/workspace.component.js index 5649c6755..eae4491ed 100644 --- a/accessible/workspace.component.js +++ b/accessible/workspace.component.js @@ -42,11 +42,12 @@ blocklyApp.WorkspaceComponent = ng.core.Component({ -

+

There are no blocks in the workspace.

@@ -68,7 +69,7 @@ blocklyApp.WorkspaceComponent = ng.core.Component({ this.treeService = treeService; this.workspace = blocklyApp.workspace; - this.ID_FOR_EMPTY_WORKSPACE_BTN = 'blocklyEmptyWorkspaceButton'; + this.ID_FOR_EMPTY_WORKSPACE_BTN = blocklyApp.ID_FOR_EMPTY_WORKSPACE_BTN; } ], getActiveDescId: function(treeId) {