[Android] Native gesture docs: a wrapped ScrollView lets RNGH Pressable fire onPress after a swipe

Abierto
#4,703 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@stussysenik ya está trabajando en esto.

Desde el 20/11/2026.

  • #4705 de @stussysenik — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
android, javascript, react-native, typescript

Línea de trabajo

Start with the Native gesture example linked in the issue and compare its wrapped ScrollView setup with the reproduction in the linked gist, especially the disallowInterruption setting. Reproduce setup 1 and setup 2 on Android using the listed fast swipe commands; the issue reports the behavior on Android and says iOS is untested. Done means the team decides whether to update the example or document when this option is needed, with the swipe repro no longer producing unintended row presses.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Platform: Android
Description

The Native gesture example wraps a React Native ScrollView in a GestureDetector with useNativeGesture({}). I used that pattern for the ScrollView of a React Native FlatList with RNGH Pressable rows. On Android, a fast swipe can scroll the list and then fire a row's onPress on release. React Native's Pressable in the same list does not (setup 5).

RNGH's own ScrollView wrapper sets disallowInterruption: true. Setting it on the wrapped list (setup 2) stopped the extra presses on both devices. Could the example set it, or say when a wrapped scroll view with pressable rows needs it? Would true make sense as the default for scroll views?

Each run sends 12 fast swipes (input swipe, 90 ms, six up then six down) with no pause between them. The table counts onPress calls per run:

# Rows List Xiaomi Emulator
1 RNGH Pressable RN FlatList in GestureDetector, useNativeGesture({}) 9, 11, 9, 9 6, 3, 5, 5
2 RNGH Pressable same, useNativeGesture({ disallowInterruption: true }) 0, 0, 0, 0 0, 0, 0, 0
3 RNGH Pressable RNGH FlatList 0, 0, 0, 0 0, 0, 0, 0
4 RNGH Pressable RN FlatList, no detector 0, 0, 0, 0 0, 0, 0, 0
5 RN Pressable RN FlatList in GestureDetector, useNativeGesture({}) 0, 0, 0, 0 0, 0, 0, 0

With an 8 s pause after each swipe, setup 1 still fired onPress 3 times in 24 swipes on the Xiaomi and 6 times in 36 on the emulator.

The logged onPress position was 448 dp from the last recorded row touch-down on the Xiaomi and 457 dp on the emulator, matching the length of the scripted swipes.

#4441 fixed presses after dragging a row in a plain RN list, and #4548 stopped Touchables from firing when a tap stops a fling in RNGH's scroll components. Both are in 3.5.0, which this repro uses. Setup 1 also fires on 3.6.0-nightly-20261116-c09aaa6af on both devices.

We first saw this with real swipes in an app, where disallowInterruption: true fixed it too. The repro uses adb to make it repeatable. I have not tested iOS.

Steps to reproduce
  1. npx create-expo-app@latest rngh-flick-press --template blank-typescript@sdk-58
  2. cd rngh-flick-press && npm install --save-exact [email protected]
  3. Replace App.tsx with the file from the gist below.
  4. npx expo run:android --variant release
  5. The app opens in setup 1. On a 1080 × 2424 portrait screen, scroll into the list and let it settle:
    adb shell "for i in 1 2 3; do input swipe 540 1800 540 700 400; done"
    
    Note the banner count, then swipe fast:
    adb shell "for i in 1 2 3 4 5 6; do input swipe 540 1900 540 700 90; done; for i in 1 2 3 4 5 6; do input swipe 540 700 540 1900 90; done"
    
    On other screens, keep both points inside the list, at about 78 % and 29 % of the screen height.
  6. The banner counts onPress calls, and the app logs each call (adb logcat -s ReactNativeJS).
  7. Tap the banner to switch to the next setup. Each tap resets the list and the counter.
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

https://gist.github.com/Elehiggle/3897500620b5467a73731ddd486da654/21a7ade3585a0560adf6a4430789720df1540511

Gesture Handler version

3.5.0 (also 3.6.0-nightly-20261116-c09aaa6af)

React Native version

0.88.1 (Expo SDK 58, expo 58.0.26, New Architecture)

Platforms

Android

JavaScript runtime

Hermes

Workflow

Using Expo Prebuild or an Expo development build

Build type

Release mode

Device

Real device

Device model

Xiaomi 23090RA98G (Android 16, API 36, 120 Hz); also an Android emulator (Pixel 10 profile, Android 16, API 36.1)

Acknowledgements

Yes

Lenguaje dominante
TypeScript
Estrellas
6.8k
Forks
1.1k
Merge medio
2 d 17 h
PR fusionados (30 d)
28

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de software-mansion/react-native-gesture-handler

Todos los issues de software-mansion/react-native-gesture-handler

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.