From 42c69dd11a6a631dfddc993ad8a36f2704996230 Mon Sep 17 00:00:00 2001 From: Abdul Rahman <81605929+abdulrahmancodes@users.noreply.github.com> Date: Tue, 20 May 2025 02:38:31 +0530 Subject: [PATCH] fix: Ensure attachment modal appears above Command Menu button using createPortal (#12112) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Screenshot 2025-05-19 at 12 50 48 AM Closes #12092 --- .../files/components/AttachmentList.tsx | 94 ++++++++++--------- 1 file changed, 49 insertions(+), 45 deletions(-) diff --git a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx index 9298caf28..7e5aa44ba 100644 --- a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx +++ b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx @@ -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,52 +185,55 @@ export const AttachmentList = ({ )} - {previewedAttachment && isAttachmentPreviewEnabled && ( - - - - {previewedAttachment.name} - - - - - - - - - - - Loading document viewer... - - - } - > - - - - - - )} + + + {previewedAttachment.name} + + + + + + + + + + + Loading document viewer... + + + } + > + + + + + , + document.body, + )} ); };