From 8ead7dabd8b2ff1354a39f8490bcbb80e952d9ca Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Wed, 16 May 2018 14:48:41 -0700 Subject: [PATCH] Use .textContent setter for field text --- core/field.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/field.js b/core/field.js index e90c2f1bb..ce4ba1919 100644 --- a/core/field.js +++ b/core/field.js @@ -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(); };