From 5c42d2e9bac359f71aa19159250772e4c9152fc1 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Wed, 18 Mar 2026 23:48:37 +0100 Subject: [PATCH] Simplify dropzone overlay to use fixed positioning without portal Remove createPortal and main element ref/state in favor of a simple fixed overlay with top-12 offset. This avoids React 19 strict mode violations around ref access during render and setState in effects. Signed-off-by: Bryan Frimin --- .../pages/organizations/audits/AuditsPage.tsx | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/apps/console/src/pages/organizations/audits/AuditsPage.tsx b/apps/console/src/pages/organizations/audits/AuditsPage.tsx index 1e3ba18ed..5a5ee5c1d 100644 --- a/apps/console/src/pages/organizations/audits/AuditsPage.tsx +++ b/apps/console/src/pages/organizations/audits/AuditsPage.tsx @@ -22,8 +22,7 @@ import { useDialogRef, useToast, } from "@probo/ui"; -import { useCallback, useEffect, useRef, useState } from "react"; -import { createPortal } from "react-dom"; +import { useCallback, useEffect, useRef } from "react"; import { useDropzone } from "react-dropzone"; import { graphql, @@ -190,34 +189,19 @@ export default function AuditsPage(props: Props) { setDroppedFile(null); }; - const [mainEl, setMainEl] = useState(null); - useEffect(() => { - const el = document.querySelector("main"); - if (el) { - el.style.position = "relative"; - setMainEl(el); - } - return () => { - if (el) { - el.style.position = ""; - } - }; - }, []); - return (
- {isDragging && canCreateAudit && mainEl && createPortal( + {isDragging && canCreateAudit && (

{__("Drop a PDF to create an audit with a report")}

-
, - mainEl, +
)}