From 25b1d69e63f2a9929e3cd8d588716aa4a92544c3 Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Mon, 10 Jun 2024 16:25:35 -0700 Subject: [PATCH] portal all modals to prevent z-index scoping issues --- frontend/src/components/ModalWrapper/index.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/ModalWrapper/index.jsx b/frontend/src/components/ModalWrapper/index.jsx index 37041f63..bd3995ce 100644 --- a/frontend/src/components/ModalWrapper/index.jsx +++ b/frontend/src/components/ModalWrapper/index.jsx @@ -1,9 +1,12 @@ +import { createPortal } from "react-dom"; + export default function ModalWrapper({ children, isOpen }) { if (!isOpen) return null; - return ( + return createPortal(
{children} -
+ , + document.getElementById("root") ); }