Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android cannot touch #556

Open
vuongnh1705 opened this issue Nov 4, 2024 · 10 comments · May be fixed by #560
Open

Android cannot touch #556

vuongnh1705 opened this issue Nov 4, 2024 · 10 comments · May be fixed by #560

Comments

@vuongnh1705
Copy link

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
Copy link

alainib commented Nov 7, 2024

same here, cannot close it ou press button inside toast

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

@alainib
Copy link

alainib commented Nov 14, 2024

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
Copy link

adrianperomingo commented Nov 15, 2024

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
Copy link

alainib commented Nov 15, 2024

@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
Copy link

@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
Copy link

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

@LucasBolela
Copy link

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

@Rednegniw
Copy link

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

@freeboub
Copy link

freeboub commented Dec 8, 2024

I was creating a PR, and I saw this change: freeboub@6a29275
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: #560

@freeboub freeboub linked a pull request Dec 8, 2024 that will close this issue
@vincicat
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants