From 3fedb9f6e4912a8c59f217e6a78cb413db0d4c1b Mon Sep 17 00:00:00 2001 From: Mark Penner Date: Thu, 29 Sep 2016 10:27:07 -0700 Subject: [PATCH] Fixes #7824 --- src/renderers/dom/client/utils/setTextContent.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/renderers/dom/client/utils/setTextContent.js b/src/renderers/dom/client/utils/setTextContent.js index e85d863d623e1..03adef5d60cec 100644 --- a/src/renderers/dom/client/utils/setTextContent.js +++ b/src/renderers/dom/client/utils/setTextContent.js @@ -28,7 +28,7 @@ var setInnerHTML = require('setInnerHTML'); var setTextContent = function(node, text) { if (text) { var firstChild = node.firstChild; - + if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) { firstChild.nodeValue = text; return; @@ -40,6 +40,10 @@ var setTextContent = function(node, text) { if (ExecutionEnvironment.canUseDOM) { if (!('textContent' in document.documentElement)) { setTextContent = function(node, text) { + if (node.nodeType === 3) { + node.nodeValue = text; + return; + } setInnerHTML(node, escapeTextContentForBrowser(text)); }; }