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 animating from 0
to non-number/pixel keyframe arrays
#1310
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 73fe288:
|
18a834c
to
f045410
Compare
@@ -191,6 +183,8 @@ const checkAndConvertChangedValueTypes = ( | |||
// as it'd be doing multiple resize-remeasure operations. | |||
if (isKeyframesTarget(to)) { | |||
const numKeyframes = to.length | |||
from = to[0] ?? to[1] |
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.
Skimming through the diff, this seems to be the only line that has actually changed, and I don't understand how this change would fix the issue, could you provide additional context?
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.
If it’s keyframes the “from” value was wrong previously - were actually animating from the values defined here
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.
Should we update line:189 as well for (let i = to[0] === null ? 1 : 0;
. Technically it should always start from the next index we picked up for from
right? Can the keyframes array contain undefined
?
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.
The first keyframe can be null
, which basically is an instruction to use the current value. But yeah this should be a fromIndex, check out the updated version
9791707
to
73fe288
Compare
At some point during Motion 5 we started parsing all
0-unit
values as0
which erroneously failed this check.Fixes #1308