Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

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

CatsJuice343152e162e0
diff --git a/packages/frontend/core/src/modules/peek-view/view/modal-container.tsx b/packages/frontend/core/src/modules/peek-view/view/modal-container.tsx
index b52f7db9ff..00cd7db8df 100644
--- a/packages/frontend/core/src/modules/peek-view/view/modal-container.tsx
+++ b/packages/frontend/core/src/modules/peek-view/view/modal-container.tsx
@@ -9,6 +9,7 @@ import {
useCallback,
useContext,
useEffect,
+ useLayoutEffect,
useRef,
useState,
} from 'react';
@@ -313,7 +314,7 @@ export const PeekViewModalContainer = forwardRef<
};
}, [onOpenChange]);
- useEffect(() => {
+ useLayoutEffect(() => {
if (animation === 'zoom') {
open ? animateZoomIn() : animateZoomOut();
} else if (animation === 'fade') {