Skip to content

Commit df43cc7

Browse files
gitimFacebook Github Bot
authored and
Facebook Github Bot
committed
Fix animation in fast navigation between scenes
Summary: There is a bug in navigation animation: ![-05-2016 16-04-23](https://cloud.githubusercontent.com/assets/3778452/20030228/8d93bc3e-a371-11e6-87d6-2c5c994733b5.gif) navigation animation from route-2 was awful, route-3 scene appeared without any animation, I pushed above example to gitim@46dd8c9. This bug can be reproduced when user navigates to the next scene immediately after navigation to the current one or when navigating between scenes programmatically (e.g. between loading scene and whatever next scene). I made some investigation and It looks like that `progress` should be reseted before building the new _transitionProps. The above example after applying this patch: ![-05-2016 16-12-16](https://cloud.githubusercontent.com/assets/3778452/20030259/a800681e-a372-11e6-847a-991d355a5940.gif) Closes #10761 Differential Revision: D4226864 Pulled By: mkonicek fbshipit-source-id: 31dceb6c8e497b2cbd891bbda4cb3add01cbcca0
1 parent 2121527 commit df43cc7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Libraries/NavigationExperimental/NavigationTransitioner.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,16 @@ class NavigationTransitioner extends React.Component<any, Props, State> {
127127
scenes: nextScenes,
128128
};
129129

130-
this._prevTransitionProps = this._transitionProps;
131-
this._transitionProps = buildTransitionProps(nextProps, nextState);
132-
133130
const {
134131
position,
135132
progress,
136133
} = nextState;
137134

135+
progress.setValue(0);
136+
137+
this._prevTransitionProps = this._transitionProps;
138+
this._transitionProps = buildTransitionProps(nextProps, nextState);
139+
138140
// get the transition spec.
139141
const transitionUserSpec = nextProps.configureTransition ?
140142
nextProps.configureTransition(
@@ -151,8 +153,6 @@ class NavigationTransitioner extends React.Component<any, Props, State> {
151153
const {timing} = transitionSpec;
152154
delete transitionSpec.timing;
153155

154-
progress.setValue(0);
155-
156156
const animations = [
157157
timing(
158158
progress,

0 commit comments

Comments
 (0)