From a6b48ab11d2a50d5fc2577dc34114dee1bc1d9eb Mon Sep 17 00:00:00 2001 From: ambar Date: Thu, 27 Nov 2025 11:42:39 +0800 Subject: [PATCH] Support iOS 13 by using MediaQueryList#addListener as a fallback --- packages/framer-motion/src/utils/reduced-motion/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/framer-motion/src/utils/reduced-motion/index.ts b/packages/framer-motion/src/utils/reduced-motion/index.ts index b6cbe47bff..f17acce005 100644 --- a/packages/framer-motion/src/utils/reduced-motion/index.ts +++ b/packages/framer-motion/src/utils/reduced-motion/index.ts @@ -11,7 +11,12 @@ export function initPrefersReducedMotion() { const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches) - motionMediaQuery.addEventListener("change", setReducedMotionPreferences) + if (motionMediaQuery.addEventListener) { + motionMediaQuery.addEventListener("change", setReducedMotionPreferences) + } else { + // iOS (Safari) 13 doesn't support addEventListener, so we use addListener instead + motionMediaQuery.addListener(setReducedMotionPreferences) + } setReducedMotionPreferences() } else {