-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
Fix transitions aborting on repeated style values #257
base: master
Are you sure you want to change the base?
Conversation
Before this fix the following could happen: 1. Button receives props { otherProp: valA style: {translateY: 50} } 2. Transition starts to translate button to 50. 3. While transition is happening Button receives the following props { otherProp: valB style: {translateY: 50} } 4. Transition is aborted and Button "jerks" to the target state of the transition. This update makes react-native-animatable ignore repeated style props and only start transitions when new values are received.
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.
Pleased Travis who complained for good reasons
I'm not fully content with this fix. While it's sensible to only start transitions for changed styles transitions will still jerk if new style props are received while a transition is running. E.g:
This does not happen with a normal Animation.Value which would just update the running transition to animate to 90 from whatever position it's currently in. |
Copy and paste error in needsInterpolation check
Fixed the above for animations not using interpolation. Still exists in those that do. |
I failed to find documentation for this, but I found this issue: oblador#174
* Fix typing of AnimatableProperties.animation * Add custom animation usage examples in Readme
Copy and paste error in needsInterpolation check
Before this fix the following could happen:
{
otherProp: valA
style: {translateY: 50}
}
{
otherProp: valB
style: {translateY: 50}
}
This update makes react-native-animatable ignore repeated style props and only start transitions when new values are received.