Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mnpenner committed Sep 29, 2016
1 parent 4f345e0 commit 5d79088
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 5d79088

Please sign in to comment.