Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 57eeaa9

Browse filesBrowse files
committed
refactor(CModal): improve the click outside listener
1 parent d85624f commit 57eeaa9
Copy full SHA for 57eeaa9

File tree

1 file changed

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

1 file changed

+1
-4
lines changed

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

Copy file name to clipboardExpand all lines: packages/coreui-react/src/components/modal/CModal.tsx
+1-4Lines changed: 1 addition & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.