fix: Fixed issue where reduced motion preference would not be honored for some animations

This commit is contained in:
Aman Harwara
2023-01-28 13:59:47 +05:30
parent cbe27303fe
commit 3d9c9e8565

View File

@@ -19,6 +19,7 @@ import {
} from '@/Components/Panes/PaneAnimator'
import { isPanesChangeLeafDismiss, isPanesChangePush } from '@/Controllers/PaneController/panesForLayout'
import { log, LoggingDomain } from '@/Logging'
import { useMediaQuery } from '@/Hooks/useMediaQuery'
const NAVIGATION_PANEL_MIN_WIDTH = 48
const ITEMS_PANEL_MIN_WIDTH = 200
@@ -53,7 +54,8 @@ const PanesSystemComponent = () => {
const [_editorRef, setEditorRef] = useState<HTMLDivElement | null>(null)
const animationsSupported = isMobile
const prefersReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)')
const animationsSupported = isMobile && !prefersReducedMotion
useEffect(() => {
if (!animationsSupported) {