Skip to content

Commit dea8562

Browse files
committed
Fall back to insertBefore when the moved node was detached externally
1 parent e9415cf commit dea8562

2 files changed

Lines changed: 440 additions & 404 deletions

File tree

src/diff/children.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ function insert(parentVNode, oldDom, parentDom, isMounting) {
405405
oldDom = getDomSibling(parentVNode);
406406
}
407407

408-
if (HAS_MOVE_BEFORE_SUPPORT && !isMounting) {
408+
if (HAS_MOVE_BEFORE_SUPPORT && !isMounting && parentVNode._dom.parentNode) {
409409
// @ts-expect-error This isn't added to TypeScript lib.d.ts yet
410410
parentDom.moveBefore(parentVNode._dom, oldDom);
411411
} else {

0 commit comments

Comments
 (0)