Skip to content

Commit

Permalink
🛠 Close modal when overlay is clicked, by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ohansFavour committed May 24, 2024
1 parent bfa4a4b commit b3a04d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ui/components/dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const ProviderListDialog = ({
return (
<Dialog
onCloseDialog={onCloseDialog}
closeOnOverlayClick
className="provider-dialog-container">
<DialogContent>
<div>
Expand Down

0 comments on commit b3a04d0

Please sign in to comment.