Fix bug #904 by explicitly grabbing focus on the workspace svg element. (#964)

This commit is contained in:
picklesrus
2017-03-03 16:15:02 -08:00
committed by GitHub
parent aff78ccc45
commit ab042d4dd8

View File

@@ -1358,6 +1358,10 @@ Blockly.WorkspaceSvg.prototype.markFocused = function() {
this.options.parentWorkspace.markFocused();
} else {
Blockly.mainWorkspace = this;
// We call e.preventDefault in many event handlers which means we
// need to explicitly grab focus (e.g from a textarea) because
// the browser will not do it for us.
this.getParentSvg().focus();
}
};