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.13k stars 982 forks source link

`Hover` nested in `ScrollView` and scrolling `ScrollView` not working simultanously on Android #3064

Closed proohit closed 2 months ago

proohit commented 3 months ago

Description

I'm trying to use Gesture.Hover in order to visualize hover effects with external mouse usage on react-native mobile (non-web).

I have a (global) ScrollView that wraps screens, that might include interactive elements (such as Pressables). These Pressables need to be visible via mouse hover. The problem is, that the GestureDetector appears to interfer with scrolling events. I have tried setting simultaneousWithExternalGesture with a ref to the scrollview, but that doesn't seem to change anything.

This does not apply to iOS. Everything works fine there.

Other (related) issues tend to focus on conflicting Gesture.Pan, but I'm having trouble with Hover as well. related issues: https://github.com/software-mansion/react-native-gesture-handler/issues/2496, https://github.com/software-mansion/react-native-gesture-handler/issues/2616

also, here's a video demonstrating the below snack example:

https://github.com/user-attachments/assets/36d8104a-29c2-482e-9f34-29bbeb32679c

Steps to reproduce

  1. add scrollview (with as many items as needed to scroll but without any GestureDetector)
  2. add items with GestureDetector, setting Gesture.Hover
  3. try to scroll via mouse wheel inside the items without and with GestureDetector

alternatively, open up the below Expo Snack and scan with Expo Go

Snack or a link to a repository

https://snack.expo.dev/@d.timur/biased-indigo-cheese

Gesture Handler version

2.16.1

React Native version

0.74.5

Platforms

Android

JavaScript runtime

None

Workflow

Expo managed workflow

Architecture

None

Build type

Debug mode

Device

Real device

Device model

No response

Acknowledgements

Yes