colorfy-software / react-native-modalfy

๐Ÿฅž Modal citizen of React Native.
https://colorfy-software.gitbook.io/react-native-modalfy
MIT License
1.06k stars 41 forks source link

Closing the modal immediately after opening for the second time on Fabric #145

Open sivantha96 opened 2 months ago

sivantha96 commented 2 months ago

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

When I open the modal the first time it works fine. The second time it opens up the modal, but seems like its invisible because of the translateY. It will start showing both modals after I open another modal. This issue started to occur after I enabled fabric.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-modalfy/src/lib/ModalStack.tsx b/node_modules/react-native-modalfy/src/lib/ModalStack.tsx
index 6eb20bb..9f5986f 100644
--- a/node_modules/react-native-modalfy/src/lib/ModalStack.tsx
+++ b/node_modules/react-native-modalfy/src/lib/ModalStack.tsx
@@ -47,7 +47,7 @@ const ModalStack = <P extends ModalfyParams>(props: Props<P>) => {
       }).start(() => {
         setStackStatus('hidden')
         setBackdropClosedItems([])
-        translateY.setValue(sh(100))
+        // translateY.setValue(sh(100))
       })
     }
   }, [backdropAnimationDuration, opacity, translateY, stackStatus])

This issue body was partially generated by patch-package.

CharlesMangwa commented 2 days ago

hi @sivantha96! thank you for spotting this issue. were you able to check if your fix also work when fabric is disabled and on web, by any chance?