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 a815992 commit dbbd7d2Copy full SHA for dbbd7d2
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