Skip to content

Commit

Permalink
Prevent RefreshControl from getting stuck when a parent is scrolled h…
Browse files Browse the repository at this point in the history
…orizontally

Reviewed By: achen1

Differential Revision: D8044763

fbshipit-source-id: 8f3351de13eb17d2937f3b9e76500889398f9c59
  • Loading branch information
olegbl authored and facebook-github-bot committed May 21, 2018
1 parent 10814e2 commit 33ffa79
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (shouldInterceptTouchEvent(ev) && super.onInterceptTouchEvent(ev)) {
NativeGestureUtil.notifyNativeGestureStarted(this, ev);

// If the pull-to-refresh gesture is interrupted by a parent with its own
// onInterceptTouchEvent then the refresh indicator gets stuck on-screen
// so we ask the parent to not intercept this touch event after it started
if (getParent() != null) {
getParent().requestDisallowInterceptTouchEvent(true);
}

return true;
}
return false;
Expand Down

0 comments on commit 33ffa79

Please sign in to comment.