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.08k stars 977 forks source link

RectButton gets triggered while scrolling, causing it to stop working after some triggers #2625

Closed AradSharafi closed 3 months ago

AradSharafi commented 1 year ago

Description

I have a RectButton that contains a horizontal ScrollView with multiple TouchableWithoutFeedback (from react-native) components. When I attempt to scroll through the ScrollView, the RectButton gets triggered and after a few touches, it stops working across the entire project.

By the way, It does not matter ScrollView or TouchableWithoutFeedback imported form react-native or react-native-gesture-handler

untitled.webm

Steps to reproduce

  1. Create a ScrollView that contains multiple TouchableWithoutFeedback components from react-native.
  2. Wrap the ScrollView in a RectButton from react-native-gesture-handler.
  3. Try to scroll through the ScrollView.

Snack or a link to a repository

https://snack.expo.dev/Kbb33iORY?platform=android

Gesture Handler version

2.12.0

React Native version

0.72.3

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo managed workflow

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

m-bert commented 1 year ago

Hi @AradSharafi! I've just tested that on 3 phones + on emulator. It looks ok on physical devices, though the problem sometimes appears on emulator. On what type of device have you tested that?

Also, by "ok" I mean that when you start scrolling immediately, it will scroll. But if you wait a little, RectButton triggers.

AradSharafi commented 1 year ago

Hi @m-bert,

Thanks for your response. I've tested this on both a physical device and an emulator. The issue has occurred on both platforms.

For the physical devices, I used a Samsung J8 running Android 10 and a Samsung J5 Pro running Android 9. On the emulator, I used an environment set up for Android 13.

I've noticed the issue doesn't just occur when I start scrolling immediately. It also happens when I wait a bit before scrolling. The RectButton triggers in both cases, which seems to be the root of the problem.

Do you have any other suggestions on what I could try to resolve this? Or is there more information you need about my setup or the issue itself?

Thanks in advance for your help!

j-piasecki commented 3 months ago

I believe it was fixed by https://github.com/software-mansion/react-native-gesture-handler/pull/2693. Let me know if it didn't help.