Make insertion markers match the size of the source block

This commit is contained in:
Rachel Fenichel
2018-08-06 17:12:14 -07:00
parent 9aa54ac487
commit e794b6883f

View File

@@ -271,6 +271,17 @@ Blockly.InsertionMarkerManager.prototype.createMarkerBlock_ = function(sourceBlo
result.domToMutation(oldMutationDom);
}
}
// Copy field values from the other block. These values may impact the
// rendered size of the insertion marker. Note that we do not care about
// child blocks here.
for (var i = 0; i < sourceBlock.inputList.length; i++) {
var input = sourceBlock.inputList[i];
for (var j = 0; j < input.fieldRow.length; j++) {
var field = input.fieldRow[j];
result.setFieldValue(field.getValue(), field.name);
}
}
result.initSvg();
result.getSvgRoot().setAttribute('visibility', 'hidden');
} finally {