[Android] v3 `ReanimatedSwipeable` takes over a vertical scroll in a React Native list once the finger drifts 10 dp sideways
メンテナーはふだん 2 日以内に返信
@JaydeepAgravat がすでに取り組んでいます。
2026年11月6日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- android, react-native, typescript
調査の方向性
Start by tracing RNGestureHandlerRootHelper.requestDisallowInterceptTouchEvent() and GestureHandlerOrchestrator.cancelAllLegacyHandlers(), then check how v3 detector action types are handled alongside the deferred cancellation from #4441. Reproduce with the linked example on Android using a vertical drag with sideways drift. Done when the React Native list keeps scrolling without opening a swipeable row, while existing gesture cancellation behavior still works.
索引モデルが issue の本文から書いたものです。
説明
Description
On Android, a ReanimatedSwipeable row inside a React Native FlatList / SectionList / ScrollView can take the touch away from a scroll that has already started. A vertical scroll with any slight sideways drift (a normal thumb arc) gets cancelled, and the row under the finger swipes open instead. iOS doesn't have the problem: once UIScrollView's pan has recognized, the row can't activate.
The cause looks like the same gap as #4432, this time for gestures created with the v3 hooks:
- When React Native's
ScrollViewstarts dragging, it callsrequestDisallowInterceptTouchEvent(true).RNGestureHandlerRootHelper.requestDisallowInterceptTouchEvent()responds withGestureHandlerOrchestrator.cancelAllLegacyHandlers(), which only cancels handlers whose action type isJS_FUNCTION_OLD_API,JS_FUNCTION_NEW_API,REANIMATED_WORKLETorNATIVE_ANIMATED_EVENT. ReanimatedSwipeablenow usesusePanGesturewith the v3GestureDetector, so its pan is attached withACTION_TYPE_NATIVE_DETECTOR. That type isn't in the list above.- #4441 added deferred cancellation (
cancelHandlersOnNativeTouchGrab), but it only coversNativeViewGestureHandlers that opt in (buttons).
As a result the scroll view's touch grab doesn't cancel the swipeable's pan. The pan keeps tracking for the rest of the scroll and activates as soon as the total horizontal movement passes activeOffsetX (10 dp by default). The root then intercepts and cancels the ScrollView mid-scroll.
The v2 Swipeable and the v2 Gesture.Pan() API didn't have this problem, because their action types are in cancelAllLegacyHandlers, so this is a regression for anyone moving to v3.
Workaround: use gesture-handler's ScrollView as the list's scroll view (renderScrollComponent={(props) => <ScrollView {...props} />}) together with gesture-handler's RefreshControl. The scroll then takes part in the orchestrator's normal arbitration and wins once it's active.
Steps to reproduce
- Render a vertical React Native
FlatList(not gesture-handler's) ofReanimatedSwipeablerows withrenderRightActions. - On an Android device, drag upward about 900 px with roughly 250 px of leftward drift (about 15° off vertical).
- The list barely scrolls, and the row under the finger swipes open to its right actions.
- Drag straight up the same distance: the list scrolls normally.
- Switch the list to gesture-handler's
FlatList(or pass gesture-handler'sScrollViewviarenderScrollComponent) and repeat step 2: the list scrolls and no row opens.
import { FlatList, Text, View } from 'react-native';
import ReanimatedSwipeable from 'react-native-gesture-handler/ReanimatedSwipeable';
const data = Array.from({ length: 50 }, (_, i) => String(i));
export default function App() {
return (
<FlatList
data={data}
keyExtractor={(item) => item}
renderItem={({ item }) => (
<ReanimatedSwipeable
renderRightActions={() => <View style={{ width: 80, backgroundColor: 'red' }} />}
>
<View style={{ height: 72, justifyContent: 'center', padding: 16, backgroundColor: '#eee' }}>
<Text>Row {item}</Text>
</View>
</ReanimatedSwipeable>
)}
/>
);
}
Suggested fix: include ACTION_TYPE_NATIVE_DETECTOR (and ACTION_TYPE_VIRTUAL_DETECTOR, if it applies) in the handlers cancelled when a native view grabs the touch mid-gesture, or give them the deferred grabbedMidGesture treatment from #4441.
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
https://github.com/IGx89/rngh-swipeable-scroll-repro
Gesture Handler version
3.3.0 (code unchanged on main / 3.4.0)
React Native version
0.88.1
Platforms
Android
JavaScript runtime
Hermes
Workflow
Using Expo Prebuild or an Expo development build
Build type
Debug mode
Device
Real device
Device model
Samsung Galaxy XCover Pro (SM-G715U), Android 13
Acknowledgements
Yes
- 主要言語
- TypeScript
- スター
- 6.8k
- フォーク
- 1.1k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 46
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
software-mansion/react-native-gesture-handler のほかの issue
-
[Jest][3.5.0] `fireEvent.press` no longer reaches `Touchable` when its child is inside an `InterceptingGestureDetector`対応中かも @m-bert が 3 日前に担当しました。 オープンMissing info Platform: Web
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
software-mansion/react-native-gesture-handler#4689 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
[Web] GestureDetector blocks context menu by default対応中かも @lassiecoder が 4 日前に担当しました。 オープンPlatform: Web
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
software-mansion/react-native-gesture-handler#4687 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
Jest: with the hook API, raw touch events fired under a `GestureDetector` don't reach ancestors under Testing Library 14再び着手できるかも @aliassar が 13 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンPlatform: Android Platform: iOS
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
software-mansion/react-native-gesture-handler#4656 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
[Android] A held tap on a Touchable or Pressable in ScrollView does nothing while the keyboard is up対応中かも @m-bert が 6 日前に担当しました。 オープンMissing repro Platform: Android
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
software-mansion/react-native-gesture-handler#4653 · コメント 7 件 ·
メンテナーはふだん 2 日以内に返信
-
[IOS] The "hitslop" attribute used in the packaging component FlatList does not work as expected.オープンClose when stale Missing repro Platform: iOS
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
software-mansion/react-native-gesture-handler#4649 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
software-mansion/react-native-gesture-handler の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
pollen-robotics/reachy-mini-desktop-app#341 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
mike-north/AgentMonitors#648 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vercel-labs/ui#700 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信