Call forceRerender instead of setText

This commit is contained in:
Rachel Fenichel
2017-11-17 14:39:12 -08:00
parent 6a2112641f
commit 3b81eede3e
2 changed files with 4 additions and 5 deletions

View File

@@ -1032,9 +1032,10 @@ Blockly.BlockSvg.prototype.updateColour = function() {
}
// Bump every dropdown to change its colour.
// TODO (#1456)
for (var x = 0, input; input = this.inputList[x]; x++) {
for (var y = 0, field; field = input.fieldRow[y]; y++) {
field.setText(null);
field.forceRerender();
}
}
};

View File

@@ -115,10 +115,8 @@ Blockly.FieldDropdown.prototype.init = function() {
' ' + Blockly.FieldDropdown.ARROW_CHAR));
Blockly.FieldDropdown.superClass_.init.call(this);
// Force a reset of the text to add the arrow.
var text = this.text_;
this.text_ = null;
this.setText(text);
// Make sure the arrow gets rendered.
this.forceRerender();
};
/**