Skip to content

Commit 57eeaa9

Browse files
committed
refactor(CModal): improve the click outside listener
1 parent d85624f commit 57eeaa9

File tree

1 file changed

+1
-4
lines changed
  • packages/coreui-react/src/components/modal

1 file changed

+1
-4
lines changed

packages/coreui-react/src/components/modal/CModal.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
200200
}, [_visible])
201201

202202
const handleClickOutside = (event: Event) => {
203-
if (
204-
modalContentRef.current &&
205-
!modalContentRef.current.contains(event.target as HTMLElement)
206-
) {
203+
if (modalRef.current && modalRef.current == event.target) {
207204
handleDismiss()
208205
}
209206
}

0 commit comments

Comments
 (0)