calintamas / react-native-toast-message

Animated toast message component for React Native
MIT License
1.73k stars 264 forks source link

Android cannot touch #556

Open vuongnh1705 opened 2 weeks ago

vuongnh1705 commented 2 weeks ago

I can't touch the button in the layout in my custom layout, even if it's default, I can't touch it. While iOS works normally

alainib commented 1 week ago

same here, cannot close it ou press button inside toast

i tried with z-index: 999; , no resutlt

alainib commented 3 days ago

i still have this bug , cannot push new version of store. any fix please ?

it work on reel android devices but simulator is not working, it was working on both before i'm afraid to don't work on some devices

truncated and cannot click on blue button

Capture d’écran 2024-11-14 à 17 09 05
adrianperomingo commented 2 days ago

same issue here after update to React Native v0.76.1 using react-native-toast-message v2.2.1. So a permanent toast message is a problem because it never disappears

alainib commented 2 days ago

@adrianperomingo

same issue here after update to React Native v0.76.1 using react-native-toast-message v2.2.1. So a permanent toast message is a problem because it never disappears

rollback to 2.2.0 my package.json

"scripts": {
    ...
    "setup": "yarn install && patch-package && cd ios && pod install && cd .. ",
}, 
"dependencies": {
    "react-native-toast-message": "2.2.0",
    "patch-package": "^8.0.0",
}

create a patch package like this :

in yourfolder/patches/react-native-toast-message+2.2.0.patch put this

diff --git a/node_modules/react-native-toast-message/lib/src/hooks/useSlideAnimation.js b/node_modules/react-native-toast-message/lib/src/hooks/useSlideAnimation.js
index 33f0b87..97e2423 100644
--- a/node_modules/react-native-toast-message/lib/src/hooks/useSlideAnimation.js
+++ b/node_modules/react-native-toast-message/lib/src/hooks/useSlideAnimation.js
@@ -16,7 +16,7 @@ export function useSlideAnimation({ position, height, topOffset, bottomOffset, k
     const animate = React.useCallback((toValue) => {
         Animated.spring(animatedValue.current, {
             toValue,
-            useNativeDriver,
+            useNativeDriver: true,
             friction: 8
         }).start();
     }, []);

and run patch package with yarn setup

adrianperomingo commented 2 days ago

@alainib thank you for the fix, it worked perfectly.

I recommend you to install patch-package in devDependencies Also, remove from your script setup the part of patch-package and add the script "postinstall": "patch-package". It will be ran after your yarn install automatically

Once again, thanks!

freeboub commented 2 days ago

@alainib Thank you for the patch 🙏 I tested it also on 2.2.1, it works fine ! (expo 54 with new architecture). even if this patch looks good (not intrusive and better performances), It really looks like a react native issue :/