Skip to content

fix: pressable style on android #3312

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

Conversation

adrianolsk
Copy link

Description

The pressed style is not being applied on Android,
investigating the source code and docs, I managed to get it working by adding

shouldActivateOnStart(value: boolean) (Android only)

https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/native-gesture#shouldactivateonstartvalue-boolean-android-only

and removing this early return that was causing isTouchPropagationAllowed.current to never be set on android

 if (Platform.OS !== 'ios') {
       return;
 }

Reproduction of the issue (Pressed style not applied on Android)
https://snack.expo.dev/GGXCh7UBdjhl4KOuKCGXe

Test plan

Tested fix on iPhone 16, Pixel 9 pro and Moto G8

@latekvo
Copy link
Member

latekvo commented Jan 7, 2025

Hey, I'll look into this issue, but as far as I know, removing the early return is not a good solution.
Executing the logic after that early return on platforms other than iOS is undefined behaviour, likely breaking multiple Pressable's edge cases.

@sidferreira
Copy link
Contributor

sidferreira commented Jan 30, 2025

Hey @adrianolsk ! 😄
I just reported something related #3367

@latekvo
Copy link
Member

latekvo commented Jan 31, 2025

I checked your repro, and i believe this should be fixed by #3368.
Please let me know if that PR fixes this issue for you.

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 this pull request may close these issues.

3 participants