Skip to content

Commit ffe749f

Browse files
authored
Merge pull request #102 from motiondivision/fix/variant
fix: resolve variant merging and child animation execution
2 parents 873fea6 + 27f21fc commit ffe749f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/motion/src/state/animate-updates.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function resolveStateAnimation(
106106
// If current node is a variant node, merge the control node's variant
107107
if (this.visualElement.isVariantNode) {
108108
const controlVariant = resolveVariant(this.context[name], this.options.variants, this.options.custom)
109-
resolvedVariant = controlVariant ? Object.assign(controlVariant || {}, variant) : variant
109+
resolvedVariant = controlVariant ? Object.assign(controlVariant || {}, resolvedVariant) : variant
110110
}
111111
if (!resolvedVariant)
112112
return
@@ -186,7 +186,7 @@ function setupChildAnimations(
186186

187187
return {
188188
getChildAnimations: () => Promise.all(childAnimations.map((animation) => {
189-
return typeof animation === 'function' ? animation() : animation
189+
return animation?.()
190190
})),
191191
childAnimations,
192192
}
@@ -228,7 +228,6 @@ function executeAnimations(
228228
})
229229
.catch(noop)
230230
}
231-
232231
// 获取动画Promise
233232
const getAnimationPromise = () => {
234233
const animationPromise = transition?.when

0 commit comments

Comments
 (0)