We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c522c01 commit c0607bcCopy full SHA for c0607bc
src/components/Modal/Modal.jsx
@@ -76,7 +76,12 @@ export const Modal = ({
76
useModalScrollPrevention(preventScrollUnderneath);
77
78
const onCancel = useCallback(
79
- (e) => dialogOnCancelHandler(e, closeButtonRef, restProps.onCancel),
+ (e) => {
80
+ if (e.target !== internalDialogRef.current) {
81
+ return;
82
+ }
83
+ dialogOnCancelHandler(e, closeButtonRef, restProps.onCancel);
84
+ },
85
[closeButtonRef, restProps.onCancel],
86
);
87
const onClick = useCallback(
0 commit comments