diff --git a/src/Modal.tsx b/src/Modal.tsx index 4333b0ca..f259a18b 100644 --- a/src/Modal.tsx +++ b/src/Modal.tsx @@ -54,7 +54,10 @@ export function Modal({ ...rest }: ModalProps) { const modalRef = useRef(); - const { overlayProps, underlayProps } = useOverlay(rest, modalRef); + const { overlayProps, underlayProps } = useOverlay( + { ...rest, onClose }, + modalRef + ); usePreventScroll(); const { modalProps } = useModal(); const { dialogProps, titleProps } = useDialog(rest, modalRef);