diff --git a/packages/frontend/core/src/modules/peek-view/view/modal-container.css.ts b/packages/frontend/core/src/modules/peek-view/view/modal-container.css.ts
index ffbbffb3da..4dc4454477 100644
--- a/packages/frontend/core/src/modules/peek-view/view/modal-container.css.ts
+++ b/packages/frontend/core/src/modules/peek-view/view/modal-container.css.ts
@@ -42,6 +42,12 @@ export const modalContentContainer = style({
},
},
});
+export const modalContentClip = style({
+ width: '100%',
+ height: '100%',
+ borderRadius: 'inherit',
+ overflow: 'hidden',
+});
export const dialog = style({
backgroundColor: cssVar('backgroundOverlayPanelColor'),
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 97702610b5..8d87d74b6a 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
@@ -129,7 +129,6 @@ export const PeekViewModalContainer = forwardRef<
const toRect = to.getBoundingClientRect();
targets.style.position = 'fixed';
- targets.style.overflow = 'hidden';
targets.style.opacity = '1';
lockSizeEl.style.width = zoomIn
? `${toRect.width}px`
@@ -179,7 +178,6 @@ export const PeekViewModalContainer = forwardRef<
top: '',
width: '',
height: '',
- overflow: '',
});
Object.assign(lockSizeEl.style, {
width: '100%',
@@ -200,6 +198,18 @@ export const PeekViewModalContainer = forwardRef<
},
[target]
);
+ /**
+ * ### Animation timeline:
+ * ```plain
+ * 150ms
+ * ⎮ - - - - ⎮
+ * dialog: +--------400ms--------+
+ * controls: +-------230ms-------+
+ * ⎮ - - - - - ⎮
+ * controls delay =
+ * 400 - 230 + 150
+ * ```
+ */
const animateZoomIn = useCallback(() => {
setAnimeState('animating');
setVtOpen(true);
@@ -214,10 +224,13 @@ export const PeekViewModalContainer = forwardRef<
opacity: [0, 1],
duration: 100,
},
- })
- .then(() => animateControls(true))
- .catch(console.error);
+ }).catch(console.error);
}, 0);
+ setTimeout(
+ () => animateControls(true),
+ // controls delay: to make sure the time interval for animations of dialog and controls is 150ms.
+ 400 - 230 + 150
+ );
}, [animateControls, zoomAnimate]);
const animateZoomOut = useCallback(() => {
setAnimeState('animating');
@@ -308,20 +321,27 @@ export const PeekViewModalContainer = forwardRef<
ref={contentClipRef}
className={styles.modalContentContainer}
>
-