Teact: Fix moving element to the end of fast list (follow-up)

This commit is contained in:
Alexander Zinchuk 2023-05-28 14:32:21 +02:00
parent a953869683
commit 533e82eb3c

View File

@ -373,9 +373,7 @@ function getNextSibling($current: VirtualElement): ChildNode | undefined {
return getNextSibling(lastChild);
}
const target = $current.target!;
const { nextSibling } = target;
return nextSibling || undefined;
return $current.target!.nextSibling || undefined;
}
function renderChildren(
@ -401,7 +399,7 @@ function renderChildren(
const fragment = newChildrenLength > currentChildrenLength ? document.createDocumentFragment() : undefined;
const lastCurrentChild = $current.children[currentChildrenLength - 1];
const fragmentNextSibling = fragment && (
nextSibling || lastCurrentChild ? getNextSibling(lastCurrentChild) : undefined
nextSibling || (lastCurrentChild ? getNextSibling(lastCurrentChild) : undefined)
);
for (let i = 0; i < maxLength; i++) {