Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: swiping in navigator too quickly causes the gesture to be lost
Summary:**Issue:** In the Navigator if a user attempts to navigate backwards (or forwards) through the route stack by swiping and they perform the gesture too quickly, the gesture is lost and nothing happens. **Cause:** In the `_matchGestureAction` function, the variable `moveStartedInRegion` is created and evaluates the gesture to determine if it was initiated in a valid region, (a.k.a. within the `edgeHitWidth`). The issue arises because `moveStartedInRegion` uses `currentLoc` (which is created from `gestureState.moveX`/`Y`) and when the gesture is performed using a flick of the finger, the first value of the `currentLoc` is outside of the `edgeHitWidth`. **Solution:** The solution is to track the coordinates of the initial grant (`gestureState.x0`/`y0`), and use that value instead of the `currentLoc` when evaluating `moveStartedInRegion`. The `currentLoc` is still needed however, for when the gestureState does not have a an initial x and y value, because the pan responder has not been granted. Closes #6249 Differential Revision: D3168726 Pulled By: ericvicenti fb-gh-sync-id: f2ac462e59bdc38536b99cac6a4877c99fa4e869 fbshipit-source-id: f2ac462e59bdc38536b99cac6a4877c99fa4e869
- Loading branch information