Skip to content

Commit

Permalink
Fixes #7824
Browse files Browse the repository at this point in the history
  • Loading branch information
mnpenner committed Sep 29, 2016
1 parent 1a8f0f1 commit 3fedb9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/renderers/dom/client/utils/setTextContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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));
};
}
Expand Down

0 comments on commit 3fedb9f

Please sign in to comment.