Skip to content

Commit 33ffa79

Browse files
olegblfacebook-github-bot
authored andcommitted
Prevent RefreshControl from getting stuck when a parent is scrolled horizontally
Reviewed By: achen1 Differential Revision: D8044763 fbshipit-source-id: 8f3351de13eb17d2937f3b9e76500889398f9c59
1 parent 10814e2 commit 33ffa79

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java

+8
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
8989
public boolean onInterceptTouchEvent(MotionEvent ev) {
9090
if (shouldInterceptTouchEvent(ev) && super.onInterceptTouchEvent(ev)) {
9191
NativeGestureUtil.notifyNativeGestureStarted(this, ev);
92+
93+
// If the pull-to-refresh gesture is interrupted by a parent with its own
94+
// onInterceptTouchEvent then the refresh indicator gets stuck on-screen
95+
// so we ask the parent to not intercept this touch event after it started
96+
if (getParent() != null) {
97+
getParent().requestDisallowInterceptTouchEvent(true);
98+
}
99+
92100
return true;
93101
}
94102
return false;

0 commit comments

Comments
 (0)