@trackunit/react-modal 1.0.16 → 1.0.18
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/index.cjs.js +3 -4
- package/index.esm.js +3 -4
- package/package.json +3 -3
package/index.cjs.js
CHANGED
|
@@ -173,12 +173,11 @@ const useModal = ({ closeOnOutsideClick, bindTo, closeOnEsc = true } = {}) => {
|
|
|
173
173
|
closeOnOutsideClick,
|
|
174
174
|
closeOnEsc,
|
|
175
175
|
onPortalClick: ({ target }) => {
|
|
176
|
-
var _a;
|
|
177
176
|
if (!closeOnOutsideClick) {
|
|
178
177
|
return;
|
|
179
178
|
}
|
|
180
179
|
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
181
|
-
const clickingOutsideModal = !
|
|
180
|
+
const clickingOutsideModal = !modalRef.current?.contains(target);
|
|
182
181
|
if (clickingOutsideModal) {
|
|
183
182
|
closePortal();
|
|
184
183
|
}
|
|
@@ -197,8 +196,8 @@ const useModal = ({ closeOnOutsideClick, bindTo, closeOnEsc = true } = {}) => {
|
|
|
197
196
|
openPortal(e);
|
|
198
197
|
},
|
|
199
198
|
closeModal: (e) => {
|
|
200
|
-
e
|
|
201
|
-
e
|
|
199
|
+
e?.stopPropagation();
|
|
200
|
+
e?.preventDefault();
|
|
202
201
|
closePortal(e);
|
|
203
202
|
},
|
|
204
203
|
// eslint-disable-next-line local-rules/no-typescript-assertion
|
package/index.esm.js
CHANGED
|
@@ -153,12 +153,11 @@ const useModal = ({ closeOnOutsideClick, bindTo, closeOnEsc = true } = {}) => {
|
|
|
153
153
|
closeOnOutsideClick,
|
|
154
154
|
closeOnEsc,
|
|
155
155
|
onPortalClick: ({ target }) => {
|
|
156
|
-
var _a;
|
|
157
156
|
if (!closeOnOutsideClick) {
|
|
158
157
|
return;
|
|
159
158
|
}
|
|
160
159
|
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
161
|
-
const clickingOutsideModal = !
|
|
160
|
+
const clickingOutsideModal = !modalRef.current?.contains(target);
|
|
162
161
|
if (clickingOutsideModal) {
|
|
163
162
|
closePortal();
|
|
164
163
|
}
|
|
@@ -177,8 +176,8 @@ const useModal = ({ closeOnOutsideClick, bindTo, closeOnEsc = true } = {}) => {
|
|
|
177
176
|
openPortal(e);
|
|
178
177
|
},
|
|
179
178
|
closeModal: (e) => {
|
|
180
|
-
e
|
|
181
|
-
e
|
|
179
|
+
e?.stopPropagation();
|
|
180
|
+
e?.preventDefault();
|
|
182
181
|
closePortal(e);
|
|
183
182
|
},
|
|
184
183
|
// eslint-disable-next-line local-rules/no-typescript-assertion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-modal",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "18.3.1",
|
|
11
11
|
"react-useportal": "1.0.18",
|
|
12
|
-
"@trackunit/react-components": "^1.0
|
|
12
|
+
"@trackunit/react-components": "^1.1.0",
|
|
13
13
|
"@trackunit/react-core-hooks": "^1.0.5",
|
|
14
14
|
"@trackunit/css-class-variance-utilities": "^1.0.1",
|
|
15
|
-
"@trackunit/i18n-library-translation": "^1.0.
|
|
15
|
+
"@trackunit/i18n-library-translation": "^1.0.8"
|
|
16
16
|
},
|
|
17
17
|
"module": "./index.esm.js",
|
|
18
18
|
"main": "./index.cjs.js",
|