From 1d753add79346627dcd78b2ac0b2f5283a3e8c61 Mon Sep 17 00:00:00 2001 From: shuangq Date: Thu, 29 Jun 2023 15:51:33 +0200 Subject: [PATCH] Ignore delay in layout animation options when instant animation flag is set --- .../framer-motion/src/animation/interfaces/motion-value.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/framer-motion/src/animation/interfaces/motion-value.ts b/packages/framer-motion/src/animation/interfaces/motion-value.ts index 50e0c8c31c..ccd4e822c5 100644 --- a/packages/framer-motion/src/animation/interfaces/motion-value.ts +++ b/packages/framer-motion/src/animation/interfaces/motion-value.ts @@ -107,7 +107,11 @@ export const animateMotionValue = ( * If we can't animate this value, or the global instant animation flag is set, * or this is simply defined as an instant transition, return an instant transition. */ - return createInstantAnimation(options) + return createInstantAnimation( + instantAnimationState.current + ? { ...options, delay: 0 } + : options + ) } /**