From 533e82eb3cac513f00c9d823052620ac258fdaaf Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sun, 28 May 2023 14:32:21 +0200 Subject: [PATCH] Teact: Fix moving element to the end of fast list (follow-up) --- src/lib/teact/teact-dom.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/teact/teact-dom.ts b/src/lib/teact/teact-dom.ts index 01b5affd5..cfede87bb 100644 --- a/src/lib/teact/teact-dom.ts +++ b/src/lib/teact/teact-dom.ts @@ -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++) {