Skip to content

Commit 317cc6a

Browse files
authored
Merge pull request #211 from motiondivision/fix/cdt
fix: handle null nodes in compareDocumentPosition
2 parents 81ac9bd + 2c6c65d commit 317cc6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/motion/src/features/animation/calc-child-stagger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function calcChildStagger(
88
staggerChildren: number = 0,
99
staggerDirection: number = 1,
1010
): number {
11-
const sortedChildren = Array.from(children).sort((a, b) => a.sortNodePosition(b))
11+
const sortedChildren = Array.from(children)
1212
const index = sortedChildren.indexOf(child)
1313
const numChildren = children.size
1414
const maxStaggerDuration = (numChildren - 1) * staggerChildren

0 commit comments

Comments
 (0)