@underverse-ui/underverse 0.2.58 → 0.2.59
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/dist/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2845,19 +2845,25 @@ var Modal = ({
|
|
|
2845
2845
|
setIsMounted(true);
|
|
2846
2846
|
return () => setIsMounted(false);
|
|
2847
2847
|
}, []);
|
|
2848
|
+
const animationRef = React11.useRef(false);
|
|
2848
2849
|
React11.useEffect(() => {
|
|
2849
2850
|
if (isOpen) {
|
|
2851
|
+
if (animationRef.current) return;
|
|
2852
|
+
animationRef.current = true;
|
|
2850
2853
|
setIsVisible(true);
|
|
2851
2854
|
setIsAnimating(true);
|
|
2852
2855
|
requestAnimationFrame(() => {
|
|
2853
2856
|
setIsAnimating(false);
|
|
2854
2857
|
});
|
|
2855
|
-
} else
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2858
|
+
} else {
|
|
2859
|
+
animationRef.current = false;
|
|
2860
|
+
if (isVisible) {
|
|
2861
|
+
setIsAnimating(true);
|
|
2862
|
+
const hideTimer = setTimeout(() => {
|
|
2863
|
+
setIsVisible(false);
|
|
2864
|
+
}, 200);
|
|
2865
|
+
return () => clearTimeout(hideTimer);
|
|
2866
|
+
}
|
|
2861
2867
|
}
|
|
2862
2868
|
}, [isOpen, isVisible]);
|
|
2863
2869
|
React11.useEffect(() => {
|