Skip to content

Commit 948f40b

Browse files
authored
Merge pull request #17 from wseow87/master
Fix compatibility with other library that make use of gesture as well
2 parents b241eff + cd21d02 commit 948f40b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/RefreshControl.web.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ export default function RefreshControl({
7575
PanResponder.create({
7676
onStartShouldSetPanResponder: () => false,
7777
onStartShouldSetPanResponderCapture: () => false,
78-
onMoveShouldSetPanResponder: () => {
78+
onMoveShouldSetPanResponder: (_,gestureState) => {
7979
if (!containerRef.current) return false
8080
const containerDOM = findNodeHandle(containerRef.current)
8181
if (!containerDOM) return false
8282
return containerDOM.children[0].scrollTop === 0
83+
&& (Math.abs(gestureState.dy) > Math.abs(gestureState.dx) * 2 && Math.abs(gestureState.vy) > Math.abs(gestureState.vx) * 2.5)
8384
},
8485
onMoveShouldSetPanResponderCapture: () => false,
8586
onPanResponderMove: (_, gestureState) => {

0 commit comments

Comments
 (0)