colorfy-software / react-native-modalfy

🥞 Modal citizen of React Native.
https://colorfy-software.gitbook.io/react-native-modalfy
MIT License
1.13k stars 46 forks source link

Modal is opened again after close the first one #120

Closed willymai closed 1 year ago

willymai commented 1 year ago

You can check reproduce example here https://snack.expo.dev/@willymai/duplicate-modal

Modal is opened twice after clicking button to close the current modal

Reproduce step

Test case 2:

with "react-native-modalfy": "3.5.1"

DovletAmanov commented 1 year ago

I face same issue with version 3.5.1. Issue goes away if I remove transitionOptions from animation config. Version 3.4.0 seems fine, temporarily downgraded.

Fagner3g commented 1 year ago

I face same problem here.

CharlesMangwa commented 1 year ago

@willymai thanks for reporting this issue! i'll be looking into asap, just have some other urgent matters to take care of before i can have some time to work on modalfy.

@DovletAmanov thank you for the info, that will help find the root cause of this issue!

CharlesMangwa commented 1 year ago

hey @willymai @DovletAmanov @Fagner3g! i think i may have fixed it actually! turned out it was an issue i stumbled upon in our own apps but in a different form. however, the fix was similar.

long story short: the issue was coming from an unnecessary use of the finished argument provided to the Animated.some_method().start()'s callback. as mentioned in react native's doc, that finished is not a boolean that indicates if the animation is done running (and therefore a callback can now be invoked). it actually simply indicates if the animation was interrupted or not while running. simply providing a callback method is enough to make sure that it'll be invoked once the animation is done (either fully or because it was interrupted): https://reactnative.dev/docs/animated#working-with-animations.

modalfy docs & examples should have all been updated to reflect that by removing any use of finished. i would recommend you do the same if you were also using finished in your apps for the modal config.

please let me know if v3.5.2 fixes this issue on your side!

sivantha96 commented 10 months ago

The issue persists on v3.5.2 as well. as @DovletAmanov suggested 3.4.0 works fine.

WooMinGy commented 8 months ago

The same issue still persists on v3.5.2. @CharlesMangwa