fix: Ensure attachment modal appears above Command Menu button using createPortal (#12112)
<img width="1509" alt="Screenshot 2025-05-19 at 12 50 48 AM" src="https://github.com/user-attachments/assets/fba95ecb-015a-4742-bda2-4d515d168c16" /> Closes #12092
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import styled from '@emotion/styled';
|
||||
import { lazy, ReactElement, Suspense, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
|
||||
import { DropZone } from '@/activities/files/components/DropZone';
|
||||
import { useUploadAttachmentFile } from '@/activities/files/hooks/useUploadAttachmentFile';
|
||||
@ -184,7 +185,9 @@ export const AttachmentList = ({
|
||||
</StyledDropZoneContainer>
|
||||
</StyledContainer>
|
||||
)}
|
||||
{previewedAttachment && isAttachmentPreviewEnabled && (
|
||||
{previewedAttachment &&
|
||||
isAttachmentPreviewEnabled &&
|
||||
createPortal(
|
||||
<StyledModal
|
||||
modalId={PREVIEW_MODAL_ID}
|
||||
size="large"
|
||||
@ -228,7 +231,8 @@ export const AttachmentList = ({
|
||||
</Suspense>
|
||||
</StyledModalContent>
|
||||
</ScrollWrapper>
|
||||
</StyledModal>
|
||||
</StyledModal>,
|
||||
document.body,
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user