fix(core): center peek zoomIn animation not work in firefox (#8817)

This commit is contained in:
CatsJuice
2024-11-14 08:30:07 +00:00
parent 97d6f53932
commit 343152e162

View File

@@ -9,6 +9,7 @@ import {
useCallback, useCallback,
useContext, useContext,
useEffect, useEffect,
useLayoutEffect,
useRef, useRef,
useState, useState,
} from 'react'; } from 'react';
@@ -313,7 +314,7 @@ export const PeekViewModalContainer = forwardRef<
}; };
}, [onOpenChange]); }, [onOpenChange]);
useEffect(() => { useLayoutEffect(() => {
if (animation === 'zoom') { if (animation === 'zoom') {
open ? animateZoomIn() : animateZoomOut(); open ? animateZoomIn() : animateZoomOut();
} else if (animation === 'fade') { } else if (animation === 'fade') {