mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Add nodes to DocumentFragments before attaching
This commit is contained in:
@@ -53,8 +53,16 @@ function insertTreeChildren(tree) {
|
||||
|
||||
var insertTreeBefore = createMicrosoftUnsafeLocalFunction(
|
||||
function(parentNode, tree, referenceNode) {
|
||||
parentNode.insertBefore(tree.node, referenceNode);
|
||||
insertTreeChildren(tree);
|
||||
// Document Fragments in IE11, Edge (and possibly others) won't update
|
||||
// correctly if they are already inserted. So we have to break out of our
|
||||
// lazy approach and append children to the fragment before inserting it.
|
||||
if (tree.node.nodeType === 11) {
|
||||
insertTreeChildren(tree);
|
||||
parentNode.insertBefore(tree.node, referenceNode);
|
||||
} else {
|
||||
parentNode.insertBefore(tree.node, referenceNode);
|
||||
insertTreeChildren(tree);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user