[Android] Native gesture docs: a wrapped ScrollView lets RNGH Pressable fire onPress after a swipe
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- android, javascript, react-native, typescript
- Lĩnh vực
- documentation, mobile, testing
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
npx create-expo-app@latest rngh-flick-press --template blank-typescript@sdk-58cd rngh-flick-press && npm install --save-exact [email protected]- Replace
App.tsxwith the file from the gist below. npx expo run:android --variant release- The app opens in setup 1. On a 1080 × 2424 portrait screen, scroll into the list and let it settle:
Note the banner count, then swipe fast:adb shell "for i in 1 2 3; do input swipe 540 1800 540 700 400; done"
On other screens, keep both points inside the list, at about 78 % and 29 % of the screen height.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" - The banner counts
onPresscalls, and the app logs each call (adb logcat -s ReactNativeJS). - 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.
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
- Ngôn ngữ chính
- TypeScript
- Star
- 6.8k
- Fork
- 1.1k
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 28
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của software-mansion/react-native-gesture-handler
-
GestureDetector should bubble touches if all gestures fail (or some other generalized solution)Đang mởMissing repro Platform: Android Platform: iOS
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 39/100
software-mansion/react-native-gesture-handler#4714 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Web] A pan that starts on a Pressable presses it when the mouse button is releasedCó thể đã có người làm @mokshupadhyay đã nhận 2 ngày trước. Đang mởPlatform: Web
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
software-mansion/react-native-gesture-handler#4713 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[iOS] Crash at app exit: static `_managers` map destroyed while `flushOperations` reads itCó thể đã có người làm @beqramo đã nhận 6 ngày trước. Đang mởMissing info Missing repro Platform: iOS Platform: MacOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
software-mansion/react-native-gesture-handler#4711 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[iOS][Fabric] Recognizer of a live handler stays on a recycled view and takes every drag on the component that reuses itCó thể đã có người làm @nihar777 đã nhận 6 ngày trước. Đang mởPlatform: iOS
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
software-mansion/react-native-gesture-handler#4710 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[iOS] Button press feedback invisible on quick taps when Reduce Motion is enabledCó thể đã có người làm @andreialecu đã nhận 8 ngày trước. Đang mởMissing info Platform: iOS Platform: MacOS
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
software-mansion/react-native-gesture-handler#4707 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của software-mansion/react-native-gesture-handler
Issue tương tự
-
agentic-workflows
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
opencollective/opencollective-frontend#12789 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Web download page shows a file as Completed when its download from S3 fails with an error responseĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
awslabs/visual-asset-management-system#2097 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
openwatersio/slackwater#591 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
compiler-explorer/compiler-explorer#9738 ·
Maintainer thường phản hồi trong vòng 2 ngày