@coreui/react 4.9.0 → 4.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.es.js +5 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/modal/CModal.tsx +5 -3
package/package.json
CHANGED
|
@@ -128,11 +128,13 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
|
|
|
128
128
|
}, [visible])
|
|
129
129
|
|
|
130
130
|
useEffect(() => {
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
if (_visible) {
|
|
132
|
+
document.addEventListener('mouseup', handleClickOutside)
|
|
133
|
+
document.addEventListener('keydown', handleKeyDown)
|
|
134
|
+
}
|
|
133
135
|
|
|
134
136
|
return () => {
|
|
135
|
-
document.removeEventListener('
|
|
137
|
+
document.removeEventListener('mouseup', handleClickOutside)
|
|
136
138
|
document.removeEventListener('keydown', handleKeyDown)
|
|
137
139
|
}
|
|
138
140
|
}, [_visible])
|