react-pure-modal 2.0.19 → 2.2.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-pure-modal",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "React modal",
|
|
5
5
|
"main": "dist/react-pure-modal.min.js",
|
|
6
6
|
"types": "dist/react-pure-modal.d.ts",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"yargs": "15.4.1"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"react": "^15.3.0 || ^16.0 || ^17.0",
|
|
71
|
-
"react-dom": "^15.3.0 || ^16.0 || ^17.0"
|
|
70
|
+
"react": "^15.3.0 || ^16.0 || ^17.0 || ^18.0",
|
|
71
|
+
"react-dom": "^15.3.0 || ^16.0 || ^17.0 || ^18.0"
|
|
72
72
|
}
|
|
73
73
|
}
|
package/src/react-pure-modal.css
CHANGED
package/src/react-pure-modal.tsx
CHANGED
|
@@ -37,10 +37,7 @@ function PureModal(props: Props) {
|
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
if (isOpen) {
|
|
39
39
|
open();
|
|
40
|
-
} else {
|
|
41
|
-
close();
|
|
42
40
|
}
|
|
43
|
-
|
|
44
41
|
return () => {
|
|
45
42
|
isOpen && close();
|
|
46
43
|
};
|
|
@@ -51,7 +48,7 @@ function PureModal(props: Props) {
|
|
|
51
48
|
|
|
52
49
|
if (allModals.length && allModals[allModals.length - 1].classList.contains(hash)) return false;
|
|
53
50
|
|
|
54
|
-
if (event.
|
|
51
|
+
if (event.key === 'Escape' && document.activeElement) {
|
|
55
52
|
close(event);
|
|
56
53
|
}
|
|
57
54
|
}, []);
|
|
@@ -242,4 +239,4 @@ function PureModal(props: Props) {
|
|
|
242
239
|
return modalContent;
|
|
243
240
|
}
|
|
244
241
|
|
|
245
|
-
export default PureModal;
|
|
242
|
+
export default React.memo(PureModal);
|