fix: temp fix for showing peek view modal for edgeless (#7155)

workaround for AFF-1200
This commit is contained in:
pengx17
2024-06-06 07:27:29 +00:00
parent 10297766b8
commit b99b964a78
2 changed files with 5 additions and 1 deletions

View File

@@ -63,9 +63,11 @@ export const PeekViewModalContainer = ({
target,
controls,
children,
hideOnEntering,
onAnimateEnd,
}: PropsWithChildren<{
open: boolean;
hideOnEntering?: boolean;
target?: HTMLElement;
onOpenChange: (open: boolean) => void;
controls: React.ReactNode;
@@ -113,7 +115,7 @@ export const PeekViewModalContainer = ({
className={styles.modalContent}
data-state={status}
>
{children}
{hideOnEntering && status === 'entering' ? null : children}
</Dialog.Content>
<div data-state={status} className={styles.modalControls}>
{controls}

View File

@@ -49,6 +49,8 @@ export const PeekViewManagerModal = () => {
: undefined
}
controls={controls}
// there is a bug for edgeless mode when showing the peek view during start up animation
hideOnEntering={activePeekView?.info.mode === 'edgeless'}
onOpenChange={open => {
if (!open) {
peekViewEntity.close();