From b3a04d0940c975ed4bd77a75fc5667d8aba0b23c Mon Sep 17 00:00:00 2001 From: Favour Ohans Date: Fri, 24 May 2024 12:15:27 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20Close=20modal=20when=20overlay?= =?UTF-8?q?=20is=20clicked,=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/components/dialog/index.tsx | 3 ++- .../tenantDetail/providerListDialog/ProviderListDialog.tsx | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/components/dialog/index.tsx b/src/ui/components/dialog/index.tsx index 324d1903..7a2474a1 100644 --- a/src/ui/components/dialog/index.tsx +++ b/src/ui/components/dialog/index.tsx @@ -26,6 +26,7 @@ type DialogCommonProps = { type DialogProps = DialogCommonProps & { title?: string; + /** Determines whether the dialog should be closed when user clicks on the overlay, true by default */ closeOnOverlayClick?: boolean; isError?: boolean; onCloseDialog: () => void; @@ -41,7 +42,7 @@ function removeNoScrollFromBody() { } function Dialog(props: DialogProps) { - const { children, className = "", closeOnOverlayClick = false, onCloseDialog, title, lockScroll = true } = props; + const { children, className = "", closeOnOverlayClick = true, onCloseDialog, title, lockScroll = true } = props; useEffect(() => { if (!lockScroll) return; diff --git a/src/ui/components/tenants/tenantDetail/providerListDialog/ProviderListDialog.tsx b/src/ui/components/tenants/tenantDetail/providerListDialog/ProviderListDialog.tsx index 0189183b..e3b775a0 100644 --- a/src/ui/components/tenants/tenantDetail/providerListDialog/ProviderListDialog.tsx +++ b/src/ui/components/tenants/tenantDetail/providerListDialog/ProviderListDialog.tsx @@ -38,7 +38,6 @@ export const ProviderListDialog = ({ return (