Use the empty field placeholder for dropdowns that do not have a value selected.

This commit is contained in:
Sean Lip
2017-01-30 16:23:40 -08:00
parent ff578359a6
commit 2c72590a01

View File

@@ -922,7 +922,11 @@ Blockly.Block.prototype.toString = function(opt_maxLength, opt_emptyToken) {
} else {
for (var i = 0, input; input = this.inputList[i]; i++) {
for (var j = 0, field; field = input.fieldRow[j]; j++) {
text.push(field.getText());
if (field instanceof Blockly.FieldDropdown && !field.getValue()) {
text.push(emptyFieldPlaceholder);
} else {
text.push(field.getText());
}
}
if (input.connection) {
var child = input.connection.targetBlock();