-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix: swiping in navigator too quickly causes the gesture to be lost #6249
Fix: swiping in navigator too quickly causes the gesture to be lost #6249
Conversation
By analyzing the blame information on this pull request, we identified @jmstout, @ericvicenti and @hedgerwang to be potential reviewers. |
0fce616
to
a178be0
Compare
@@ -804,8 +806,11 @@ var Navigator = React.createClass({ | |||
-(SCREEN_HEIGHT - edgeHitWidth) : | |||
-(SCREEN_WIDTH - edgeHitWidth); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eqeqeq: Expected '===' and instead saw '=='.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
a178be0
to
7a729da
Compare
@DUBERT updated the pull request. |
1 similar comment
@DUBERT updated the pull request. |
3d74e6b
to
c07c69e
Compare
c07c69e
to
d638957
Compare
@DUBERT updated the pull request. |
Would @jmstout, @ericvicenti or @hedgerwang mind reviewing this? It's a pretty annoying and significant bug. |
@ericvicenti would you mind taking a look at this pull request? It's been a while since the last commit was reviewed. |
Sorry for the big delay for such a clear fix! |
@facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
format code change == to ===
d638957
to
56dd6f6
Compare
@DUBERT updated the pull request. |
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 facebook#6249 Differential Revision: D3168726 Pulled By: ericvicenti fb-gh-sync-id: f2ac462e59bdc38536b99cac6a4877c99fa4e869 fbshipit-source-id: f2ac462e59bdc38536b99cac6a4877c99fa4e869
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 variablemoveStartedInRegion
is created and evaluates the gesture to determine if it was initiated in a valid region, (a.k.a. within theedgeHitWidth
). The issue arises becausemoveStartedInRegion
usescurrentLoc
(which is created fromgestureState.moveX
/Y
) and when the gesture is performed using a flick of the finger, the first value of thecurrentLoc
is outside of theedgeHitWidth
.Solution:
The solution is to track the coordinates of the initial grant (
gestureState.x0
/y0
), and use that value instead of thecurrentLoc
when evaluatingmoveStartedInRegion
. ThecurrentLoc
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.