From b98eef2ae2cea191bdd6c82b78729a5ea275ea14 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 24 Jun 2019 10:20:26 -0700 Subject: [PATCH] Fixed rendering of images & text dropdown. --- core/field_dropdown.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/field_dropdown.js b/core/field_dropdown.js index b2bf6bb72..7d070cfe0 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -456,6 +456,11 @@ Blockly.FieldDropdown.prototype.updateColour = function() { * @private */ Blockly.FieldDropdown.prototype.render_ = function() { + // Hide both elements. + this.textContent_.nodeValue = ''; + this.imageElement_.style.display = 'none'; + + // Show correct element. if (this.imageJson_) { this.renderSelectedImage_(); } else { @@ -471,6 +476,7 @@ Blockly.FieldDropdown.prototype.render_ = function() { * @private */ Blockly.FieldDropdown.prototype.renderSelectedImage_ = function() { + this.imageElement_.style.display = ''; this.imageElement_.setAttributeNS( Blockly.utils.dom.XLINK_NS, 'xlink:href', this.imageJson_.src); this.imageElement_.setAttribute('height', this.imageJson_.height);