-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Navigator - Fix wrong scene transformation after pop #9516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
@@ -692,6 +701,11 @@ var Navigator = React.createClass({ | |||
this.refs['scene_' + sceneIndex].setNativeProps(enabledSceneNativeProps); | |||
}, | |||
|
|||
_clearTransformations: function(sceneIndex) { | |||
const defaultStyle = flattenStyle([styles.defaultSceneStyle]); |
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.
react/no-string-refs: Using this.refs is deprecated.
Thanks for the great demo in #9485! @ericvicenti Does this look good to you? |
@@ -1087,6 +1101,7 @@ var Navigator = React.createClass({ | |||
var presentedRoute = this.state.routeStack[this.state.presentedIndex]; | |||
var popSceneConfig = this.props.configureScene(presentedRoute); // using the scene config of the currently presented view | |||
this._enableScene(popIndex); | |||
this._clearTransformations(popIndex); |
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.
Can you please add a comment why this is needed so people reading the code in the future understand why it's needed to reset the transform here?
10c5093
to
735bbbc
Compare
@sooth-sayer can you fix the problem that eslint-bot pointed out? |
@lacker Ok, I will fix it |
735bbbc
to
7aedb62
Compare
@sooth-sayer updated the pull request - view changes |
@@ -726,7 +742,7 @@ var Navigator = React.createClass({ | |||
}, | |||
|
|||
_setRenderSceneToHardwareTextureAndroid: function(sceneIndex, shouldRenderToHardwareTexture) { |
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.
no-return-assign: Arrow function should not return assignment.
7aedb62
to
a496d2c
Compare
@lacker fixed |
Ok this makes sense to me. @facebook-github-bot shipit |
@facebook-github-bot shipit |
I think this needs a CLA to ship it. @sooth-sayer would you mind signing the CLA? |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@lacker Ok, I signed it |
@facebook-github-bot shipit |
@lacker has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Fixes facebook#9485 Closes facebook#9516 Differential Revision: D4080618 Pulled By: lacker fbshipit-source-id: 296c209a0438c4a06b3b3556d7084c5435d60c72
Fixes #9485