From 3b81eede3e4f889bc6f5eadd74847a4a98808639 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 17 Nov 2017 14:39:12 -0800 Subject: [PATCH] Call forceRerender instead of setText --- core/block_svg.js | 3 ++- core/field_dropdown.js | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/block_svg.js b/core/block_svg.js index 86993dd11..f4618e595 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -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(); } } }; diff --git a/core/field_dropdown.js b/core/field_dropdown.js index 75a6adb94..d70212186 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -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(); }; /**