fix(dom_renderer): moveNodeAfterSiblings should not detach the reference node
Fixes #5077 Closes #5759
This commit is contained in:
parent
693d9dce5d
commit
edcb34dc9f
|
@ -365,11 +365,18 @@ function resolveInternalDomFragment(fragmentRef: RenderFragmentRef): Node[] {
|
|||
}
|
||||
|
||||
function moveNodesAfterSibling(sibling, nodes) {
|
||||
if (nodes.length > 0 && isPresent(DOM.parentElement(sibling))) {
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
DOM.insertBefore(sibling, nodes[i]);
|
||||
var parent = DOM.parentElement(sibling);
|
||||
if (nodes.length > 0 && isPresent(parent)) {
|
||||
var nextSibling = DOM.nextSibling(sibling);
|
||||
if (isPresent(nextSibling)) {
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
DOM.insertBefore(nextSibling, nodes[i]);
|
||||
}
|
||||
} else {
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
DOM.appendChild(parent, nodes[i]);
|
||||
}
|
||||
}
|
||||
DOM.insertBefore(nodes[0], sibling);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue