← 输入框|github.com|刷新
Skip to content

fix(core): keyframes without a 0% or 100% keyframe animate from and to the view's own values - #11528

Open
triniwiz wants to merge 2 commits into
mainfrom
fix/css-keyframes-implicit-ends
Open

triniwiz wants to merge 2 commits into
mainfrom
fix/css-keyframes-implicit-ends

Conversation

@triniwiz

@triniwiz triniwiz commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

PR Checklist

What is the current behavior?

A keyframe animation plays its first keyframe as a jump and holds its last one. When the keyframes leave out 0% or 100%, the animation does not behave as in CSS, where the element's own values fill the missing ends:

  • @keyframes spin { to { transform: rotate(360deg) } } jumps to 360° on every iteration, so the spinner never turns (Bootstrap's spinner-border, Tailwind's animate-spin).
  • Keyframes that stop at 50% never come back (Bootstrap's spinner-grow).

What is the new behavior?

KeyframeAnimation.keyframeAnimationFromInfo() adds the missing 0%/100% keyframe, and play() fills it with the view's own values for the properties the other keyframes animate (rotate, scale, translate, opacity, background color, width, height). An auto width or height, which cannot be animated from, is left out. The KeyframeAnimationInfo passed in is not modified.

Tests: ui/animation/keyframe-animation.spec.ts (6).

Verified with all of these core PRs merged together (#11527–#11537): apps/automated passes on the iOS 26.4 simulator (1830 OK, 0 failed) and on an Android API 36 emulator (1692 OK; the one failure is the network-dependent IMAGE-CACHE.test_ImageCache_ValidUrl timeout, which also passes on reruns).

…o the view's own values

Core played the first keyframe as a jump and held the last one, so
keyframes that leave out an end did not animate as in CSS:
`to { transform: rotate(360deg) }` jumped to 360deg on every iteration
and a spinner never turned, and keyframes that stop at 50% never came
back.

A missing 0% or 100% keyframe is now added when the animation is built,
and filled with the view's own values for the animated properties when
it plays. An auto width or height, which cannot be animated from, is
left out.
@nx-cloud

nx-cloud Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 4f32aca

Command Status Duration Result
nx run-many -t build -p core,webpack5,vite ✅ Succeeded 23s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-15 20:31:18 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11528
npm i https://pkg.pr.new/@nativescript/vite@11528
npm i https://pkg.pr.new/@nativescript/webpack@11528

commit: 4f32aca

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant