mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 09:29:07 +08:00
Change gesture direction strings in NavigatorSceneConfigs
Summary: I see there is a string matching inconsistency in `Libraries/CustomComponents/Navigator/Navigator.js` and `Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js`, which caused a bug resulting in gestures not working for vertical SceneConfigs. This PR fixes the inconsistency, and the bug. **Motivation for making this change** When working with the navigator, I was using the `VerticalUpSwipeJump` Navigator SceneConfig. The gesture to pop to the previous scene (in this case `jumpBack`) was not working. **How I tested?** I changed these strings (as shown in this PR) and swiped down. After these changes, everything worked as expected. **Example** In `Libraries/CustomComponents/Navigator/Navigator.js`, we check for gesture direction strings `bottom-to-top` and `top-to-bottom` in multiple places, but nowhere do we ever check for `up-to-down` and `down-to-up`. ``` var isTravelVertical = gesture.direction === 'top-to-bottom' || gesture.direction === 'bottom-to-top'; var isTravelInverted = Closes https://github.com/facebook/react-native/pull/11192 Differential Revision: D4392103 Pulled By: ericvicenti fbshipit-source-id: fd80578031f94b1b409815481c82e481c7ff2f13
This commit is contained in:
committed by
Facebook Github Bot
parent
56e026f9b3
commit
55ce19d84e
@@ -534,13 +534,13 @@ var BaseRightToLeftGesture = {
|
||||
var BaseDownUpGesture = {
|
||||
...BaseLeftToRightGesture,
|
||||
fullDistance: SCREEN_HEIGHT,
|
||||
direction: 'down-to-up',
|
||||
direction: 'bottom-to-top',
|
||||
};
|
||||
|
||||
var BaseUpDownGesture = {
|
||||
...BaseLeftToRightGesture,
|
||||
fullDistance: SCREEN_HEIGHT,
|
||||
direction: 'up-to-down',
|
||||
direction: 'top-to-bottom',
|
||||
};
|
||||
|
||||
// For RTL experiment, we need to swap all the Left and Right gesture and animation.
|
||||
|
||||
Reference in New Issue
Block a user