Skip to content

Commit 7ad7ad7

Browse files
committed
Add comment
1 parent aabc5b4 commit 7ad7ad7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerDetectorView.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ class RNGestureHandlerDetectorView(context: Context) : ReactViewGroup(context) {
154154
val registry = RNGestureHandlerModule.registries[moduleId]
155155
?: throw Exception("Tried to access a non-existent registry")
156156

157+
// In the native view hierarchy, a ScrollView is a child of a RefreshControl.
158+
// When attaching Native gestures to a ScrollView, first check if it is wrapped by a RefreshControl.
159+
// If so, attach the handler to the child of RefreshControl, not the RefreshControl itself.
160+
// Note: RefreshControl is wrapped with a VirtualDetector, and native gestures for it are attached in `attachVirtualChildren`.
157161
val id = if (child is ReactSwipeRefreshLayout) {
158162
child.getChildAt(0).id
159163
} else {

0 commit comments

Comments
 (0)