Fix spring + delay producing NaN for string keyframes#3584
Open
mattgperry wants to merge 1 commit intomainfrom
Open
Fix spring + delay producing NaN for string keyframes#3584mattgperry wants to merge 1 commit intomainfrom
mattgperry wants to merge 1 commit intomainfrom
Conversation
When a spring animation uses string keyframes (e.g., "90%", "60%") with a delay, the delay phase incorrectly passes the original string value through mixKeyframes, which expects a number in [0, 100]. This produces NaN, causing the element to render with invalid attribute values during the delay period. Skip the mixKeyframes transformation during the delay phase since keyframes[0] already contains the correct original value. Fixes #3351 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greptile SummaryFixes a bug where spring animations with
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: f11e74d |
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.
Summary
type: 'spring'withdelayon elements with string keyframes (e.g., SVG attributes likewidth: "90%"), the initial state was not respected during the delay period. The element would render withNaN%values, causing it to fill the entire viewport instead of showing the initial state.JSAnimation.tick(), during the delay phase,keyframes[0]is the original string value (e.g.,"90%"). For spring animations with non-numeric keyframes, amixKeyframesfunction maps numbers in [0, 100] to interpolated string values. During delay, the original string was incorrectly passed throughmixKeyframes, which divided it by 100, producingNaN.mixKeyframestransformation during the delay phase, sincekeyframes[0]already contains the correct original string value.Fixes #3351
Test plan
yarn buildpassesyarn testpasses (all 760 tests)🤖 Generated with Claude Code