react-native-toast-message icon indicating copy to clipboard operation
react-native-toast-message copied to clipboard

Android cannot touch

Open vuongnh1705 opened this issue 2 years ago • 12 comments

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

vuongnh1705 avatar Nov 04 '24 04:11 vuongnh1705

same here, cannot close it ou press button inside toast

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

alainib avatar Nov 07 '24 12:11 alainib

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

alainib avatar Nov 14 '24 16:11 alainib

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

adrianperomingo avatar Nov 15 '24 11:11 adrianperomingo

@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

alainib avatar Nov 15 '24 11:11 alainib

@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!

adrianperomingo avatar Nov 15 '24 13:11 adrianperomingo

@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 :/

freeboub avatar Nov 15 '24 16:11 freeboub

@alainib thank you for the fix, it worked perfectly. After updating expo to 52 and all the packages, the Toast stop working.

LucasBolela avatar Nov 19 '24 13:11 LucasBolela

Hi guys, are you planning to fix this issue? 🙏 Always feeling bad when I need to use patch-package.

Rednegniw avatar Dec 08 '24 16:12 Rednegniw

I was creating a PR, and I saw this change: https://github.com/freeboub/react-native-toast-message/commit/6a2927564e2340910a1c07bd7b37ca454459f487 It looks like we are trying to workaround react native issues ... BTW: enabling useNativeDriver: true on android should be the good way to do ... here is the fix: https://github.com/calintamas/react-native-toast-message/pull/560

freeboub avatar Dec 08 '24 16:12 freeboub

Note: if you are using fully custom Toast (by override each toast type via config props in <Toast>) + you only serve iOS and Android, you can simply just rollback to 2.2.0 as the animation hook is still using the correct value for all native code

for anyone who want to make the PR you can check this part: diff

vincicat avatar Dec 10 '24 15:12 vincicat

Note 2:

I even tried using RNGH to fix that with no luck. seems #428 is the main reason the useNativeDriver is turned off.

if anyone get the touch working in 2.2.1+ on Android with latest RN (0.81+) please let us know 🙏

vincicat avatar Sep 10 '25 21:09 vincicat

hello, any plan on fixing this?

dkrabdev avatar Sep 12 '25 15:09 dkrabdev