Override Reduce Motion on load-bearing animation (#9294)

This commit is contained in:
Samuel Newman
2025-10-28 18:52:31 +02:00
committed by GitHub
parent 1883f3fc7b
commit 900e569ef2
@@ -18,6 +18,7 @@ import Animated, {
cancelAnimation,
interpolate,
measure,
ReduceMotion,
runOnJS,
type SharedValue,
useAnimatedReaction,
@@ -516,6 +517,7 @@ function LightboxImage({
velocity: e.velocityY,
velocityFactor: Math.max(3500 / Math.abs(e.velocityY), 1), // Speed up if it's too slow.
deceleration: 1, // Danger! This relies on the reaction below stopping it.
reduceMotion: ReduceMotion.Never, // If this animation doesn't run, the image gets stuck - therefore override Reduce Motion
})
})
} else {
@@ -524,6 +526,7 @@ function LightboxImage({
return withSpring(0, {
stiffness: 700,
damping: 50,
reduceMotion: ReduceMotion.Never,
})
})
}