Skip to content

Commit 8515790

Browse files
authored
Merge 05098cc into c522c01
2 parents c522c01 + 05098cc commit 8515790

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/Modal/Modal.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ export const Modal = ({
7676
useModalScrollPrevention(preventScrollUnderneath);
7777

7878
const onCancel = useCallback(
79-
(e) => dialogOnCancelHandler(e, closeButtonRef, restProps.onCancel),
79+
(e) => {
80+
if (e.target !== internalDialogRef.current) {
81+
return;
82+
}
83+
dialogOnCancelHandler(e, closeButtonRef, restProps.onCancel);
84+
},
8085
[closeButtonRef, restProps.onCancel],
8186
);
8287
const onClick = useCallback(

0 commit comments

Comments
 (0)