software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.12k stars 980 forks source link

`simultaneousWithExternalGesture` regression, broken with 2.17.0, used to work with 2.16.2 #2963

Closed mgcrea closed 4 months ago

mgcrea commented 4 months ago

Description

I have some kind of zoom view in my application that has a pan/pinch/rotation gestures attached to it, on top of it I have an svg overlay (using StyleSheet.absoluteFill) that also has a pan gesture (in my case only for mouse/stylus but it does not matter). I configure simultaneousWithExternalGesture on this extra pan gesture.

This worked well before and had both gesture working but after updating to 2.17.1 (tried 2.17.0 as well), the zoom view gesture is not working anymore.

Steps to reproduce

  1. git clone --branch bug-gesture-handler-1 --single-branch https://github.com/mgcrea/react-native-reanimated-sandbox.git
  2. pnpm install; npx pod-install
  3. check that everything is working
  4. npx npm-check-updates -f react-native-gesture-handler -u
  5. pnpm install; npx pod-install
  6. check that the gesture does not work anymore

Snack or a link to a repository

https://github.com/mgcrea/react-native-reanimated-sandbox/tree/bug-gesture-handler-1

Gesture Handler version

2.17.1

React Native version

0.74.2

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Real device

Device model

iPad Pro

Acknowledgements

Yes

m-bert commented 4 months ago

Hi! I took the liberty of correcting Gesture Handler versions in PR title and description 😅

Could you please check if #2969 solves this issue?

mgcrea commented 4 months ago

@m-bert while it does fix it in the reproduction demo, unfortunately I'm still noticing the issue on my actual app (unless I made a mistake somewhere). Is there an easy way for me to inspect the gesture tags to help you check if the bug is still there?

Will double check.

m-bert commented 4 months ago

Well, you can try to log tags from event in gesture callbacks, but I'm afraid that without diving into source code it will be hard to find what is going on.

If you'd like to, you can try to look into attachHandlers and updateHandlers since they were problematic in your reproduction.

Unfortunately, without proper reproduction we can't do much 😞

mgcrea commented 4 months ago

I will try to reproduce it in the repo, might be related to the number of children inside the SVGMask on the actual app, thanks for the guidance and hopefully we can find a fix!

mgcrea commented 4 months ago

@m-bert good news, I was wrong and the fix is indeed working, not sure why but my actual app does not use the built output from either lib/commonjs or lib/module that I had patched but the typescript code from the src/.

Fixed the patch and it works! Thanks a lot!

react-native-gesture-handler@2.17.1.patch