fix: Fixed issue where some dialogs would become unresponsive

This commit is contained in:
Aman Harwara
2023-05-23 19:15:30 +05:30
parent 390ea45865
commit 1d7079e90c
2 changed files with 11 additions and 6 deletions

View File

@@ -14,7 +14,14 @@ const AlertDialog = ({
}) })
return ( return (
<Dialog store={dialog} role="alertdialog" className="fixed top-0 left-0 z-modal h-full w-full"> <Dialog
store={dialog}
role="alertdialog"
className="fixed top-0 left-0 z-modal h-full w-full"
modal={false}
portal={true}
preventBodyScroll={true}
>
<div <div
className="absolute z-0 h-full w-full bg-passive-5 opacity-25 md:opacity-75" className="absolute z-0 h-full w-full bg-passive-5 opacity-25 md:opacity-75"
role="presentation" role="presentation"

View File

@@ -32,11 +32,9 @@ const ModalOverlay = forwardRef(
className="fixed top-0 left-0 z-modal h-full w-full" className="fixed top-0 left-0 z-modal h-full w-full"
ref={mergeRefs([setElement, ref])} ref={mergeRefs([setElement, ref])}
store={dialog} store={dialog}
getPersistentElements={() => modal={false}
Array.from(document.querySelectorAll('[role="dialog"], [role="alertdialog"]')).map((el) => { portal={true}
return el.parentElement ? el.parentElement : el preventBodyScroll={true}
})
}
{...props} {...props}
> >
{children} {children}