From 2c72590a0199474790d8ba7248fa7331210cbb57 Mon Sep 17 00:00:00 2001 From: Sean Lip Date: Mon, 30 Jan 2017 16:23:40 -0800 Subject: [PATCH] Use the empty field placeholder for dropdowns that do not have a value selected. --- core/block.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/block.js b/core/block.js index f8c65c24c..42cfaa74e 100644 --- a/core/block.js +++ b/core/block.js @@ -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();