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

fix: pressable style on android #3312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
Contributor

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.

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.

2 participants