Use .textContent setter for field text

This commit is contained in:
Rachel Fenichel
2018-05-16 14:48:41 -07:00
parent f623004b3a
commit 8ead7dabd8

View File

@@ -360,10 +360,7 @@ Blockly.Field.prototype.render_ = function() {
}
// Replace the text.
goog.dom.removeChildren(/** @type {!Element} */ (this.textElement_));
var textNode = document.createTextNode(this.getDisplayText_());
this.textElement_.appendChild(textNode);
this.textElement_.textContent = this.getDisplayText_();
this.updateWidth();
};