Fix bug with tabbing out of Blockly (#3470)

* Pipe handled cursor action correctly.
This commit is contained in:
Sam El-Husseini
2019-11-22 17:30:25 -08:00
committed by GitHub
parent ffb124c58d
commit 2f87243466

View File

@@ -646,13 +646,14 @@ Blockly.BlockSvg.prototype.setCollapsed = function(collapsed) {
Blockly.BlockSvg.prototype.tab = function(start, forward) {
var tabCursor = new Blockly.TabNavigateCursor();
tabCursor.setCurNode(Blockly.ASTNode.createFieldNode(start));
var currentNode = tabCursor.getCurNode();
var action = forward ?
Blockly.navigation.ACTION_NEXT : Blockly.navigation.ACTION_PREVIOUS;
tabCursor.onBlocklyAction(action);
var nextNode = tabCursor.getCurNode();
if (nextNode) {
if (nextNode && nextNode !== currentNode) {
var nextField = /** @type {!Blockly.Field} */ (nextNode.getLocation());
nextField.showEditor();
}