react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

[iOS][Expo] PanGestureHandler does not get active when it has a `simultaneousHandlers`

Open gorhom opened this issue 1 year ago • 5 comments

Description

The new release of Expo 46 seemed had broken gesture-handler on iOS, where when a PanGestureHandler has simultaneousHandlers on, it will never get active.

I have tested the same code base on Android, and it function as expected. Also tested on a bare React Native project, and it function as expected.

This issue did break Bottom Sheet library.

Preview

Expo

expo 46.0.6, react-native 0.69.4, react-native-gesture-handler 2.5.0, react-native-reanimated 2.9.1

https://user-images.githubusercontent.com/4061838/184496206-8ac2e172-aa55-430b-89c0-b28b4212a063.mov

React Native

react-native 0.69.4, react-native-gesture-handler 2.5.0, react-native-reanimated 2.9.1

https://user-images.githubusercontent.com/4061838/184496221-e571956e-7aee-49a1-be34-55228ddb4bae.mov

Steps to reproduce

  1. Run the snack provided on iOS
  2. Scroll the list

State won't get active

  1. Run the snack provided on Android
  2. Scroll the list

State will get active

Snack or a link to a repository

https://snack.expo.dev/@gorhom/7a1a40

Gesture Handler version

2.5.0

React Native version

0.69.4

Platforms

iOS

JavaScript runtime

JSC

Workflow

Expo managed workflow

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Real device

Device model

iPhone

Acknowledgements

Yes

gorhom avatar Aug 13 '22 13:08 gorhom

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Platforms section.

github-actions[bot] avatar Aug 13 '22 13:08 github-actions[bot]

Some more informations from my side:

  • Running the code in SDK 45 works
  • Being at SDK 46, we tried to downgrade RNGH to 2.2.1, 2.4.0
  • Being at SDK 46, we tried to downgrade REA and RNS to 2.8.0 and 3.11.1 an 3.14.1

onActive does not trigger with Expo, while it does with bare. I also used @gorhom Repro and ported it to RNGH v2, with GestureDetector. It is the same. onActive does not trigger.

hirbod avatar Aug 13 '22 14:08 hirbod

Lol, EVERYTHING works in release mode. Its only dev mode thats broken. Here is a release video:

P:S: No difference between Hermes or JSC. The issue happens on both

https://user-images.githubusercontent.com/504909/184499657-a585e3e5-3b7b-4267-8c3b-9f1386ee03fb.mp4

hirbod avatar Aug 13 '22 14:08 hirbod

i don't believe that this is an issue in react-native-gesture-handler itself, i can only reproduce this in projects with expo-dev-client installed or in expo go.

brentvatne avatar Aug 13 '22 17:08 brentvatne

Yes, thats the same I was thinking and what I shared at twitter:

And I might have a GUESS what could be the issue: 3 finger long press gesture detection maybe for the dev menu, but its just a gut feeling

hirbod avatar Aug 13 '22 17:08 hirbod

Thank for the detailed report, I'll look into it but I don't know how much I'll be able to help if it's an issue with Expo.

As a sidenote, it's interesting that it was working in SDK 45 as it looks really similar to https://github.com/software-mansion/react-native-gesture-handler/issues/1848 and https://github.com/software-mansion/react-native-gesture-handler/issues/1804, both of which are affecting only managed workflow.

j-piasecki avatar Aug 16 '22 12:08 j-piasecki

I can confirm that this issue is caused by something in the dev-client codebase and I think I'll have a solution soon ;)

lukmccall avatar Aug 16 '22 12:08 lukmccall

If you're using the expo-dev-client, you can already test out the fix. Just bump the version of dev-client to 1.2.1. The same fix will be available in Expo Go soon ;)

lukmccall avatar Aug 16 '22 14:08 lukmccall

Thanks for the quick fix. Will report back soon

hirbod avatar Aug 16 '22 16:08 hirbod

I can confirm that there are no issues anymore with 1.2.1! Thanks a ton

hirbod avatar Aug 17 '22 15:08 hirbod

We had the same issue at my company. Upgrading the dev-client to 1.2.1 solved the issue for us. If anyone's curious, here's the relevant commit: https://github.com/expo/expo/commit/0ce07b3d1cc2c59fd213982266a44d54c5715358

MarceloPrado avatar Aug 17 '22 20:08 MarceloPrado

This was driving me crazy, thanks so much for pointing out the fix!! Confirmed working here as well.

erquhart avatar Aug 20 '22 16:08 erquhart