@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 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 if (isVisible) {
2856
- setIsAnimating(true);
2857
- const hideTimer = setTimeout(() => {
2858
- setIsVisible(false);
2859
- }, 200);
2860
- return () => clearTimeout(hideTimer);
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(() => {