@trackunit/react-modal 1.25.15 → 1.26.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/index.cjs.js +3 -2
- package/index.esm.js +3 -2
- package/package.json +3 -3
package/index.cjs.js
CHANGED
|
@@ -906,13 +906,14 @@ const useModal = (props) => {
|
|
|
906
906
|
}
|
|
907
907
|
},
|
|
908
908
|
});
|
|
909
|
-
// Cleanup: notify context when component unmounts while modal is open.
|
|
909
|
+
// Cleanup: notify context when component unmounts while modal is open or mid-close.
|
|
910
910
|
// Calls closeModal() directly (no animation to wait for during unmount).
|
|
911
911
|
react.useEffect(() => {
|
|
912
912
|
return () => {
|
|
913
913
|
stopCloseTimeout();
|
|
914
|
+
const wasPendingClose = pendingCloseModalRef.current;
|
|
914
915
|
pendingCloseModalRef.current = false;
|
|
915
|
-
if (isOpenRef.current) {
|
|
916
|
+
if (isOpenRef.current || wasPendingClose) {
|
|
916
917
|
void closeModal();
|
|
917
918
|
}
|
|
918
919
|
};
|
package/index.esm.js
CHANGED
|
@@ -904,13 +904,14 @@ const useModal = (props) => {
|
|
|
904
904
|
}
|
|
905
905
|
},
|
|
906
906
|
});
|
|
907
|
-
// Cleanup: notify context when component unmounts while modal is open.
|
|
907
|
+
// Cleanup: notify context when component unmounts while modal is open or mid-close.
|
|
908
908
|
// Calls closeModal() directly (no animation to wait for during unmount).
|
|
909
909
|
useEffect(() => {
|
|
910
910
|
return () => {
|
|
911
911
|
stopCloseTimeout();
|
|
912
|
+
const wasPendingClose = pendingCloseModalRef.current;
|
|
912
913
|
pendingCloseModalRef.current = false;
|
|
913
|
-
if (isOpenRef.current) {
|
|
914
|
+
if (isOpenRef.current || wasPendingClose) {
|
|
914
915
|
void closeModal();
|
|
915
916
|
}
|
|
916
917
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-modal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@floating-ui/react": "^0.26.25",
|
|
11
|
-
"@trackunit/react-components": "1.
|
|
11
|
+
"@trackunit/react-components": "1.25.0",
|
|
12
12
|
"@trackunit/css-class-variance-utilities": "1.13.5",
|
|
13
13
|
"@trackunit/shared-utils": "1.15.5",
|
|
14
14
|
"@floating-ui/react-dom": "2.1.2",
|
|
15
15
|
"@trackunit/react-core-contexts-api": "1.17.5",
|
|
16
|
-
"@trackunit/i18n-library-translation": "1.
|
|
16
|
+
"@trackunit/i18n-library-translation": "1.22.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@tanstack/react-router": "^1.114.29",
|