Fix transitions aborting on repeated style values#257
Open
solidfox wants to merge 18 commits intooblador:masterfrom
Open
Fix transitions aborting on repeated style values#257solidfox wants to merge 18 commits intooblador:masterfrom
solidfox wants to merge 18 commits intooblador:masterfrom
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.
solidfox
commented
Mar 6, 2019
Author
|
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
Author
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.