Skip to content

feat: web support for CSS animation callbacks#9605

Open
MatiPl01 wants to merge 1 commit into
mainfrom
@matipl01/css-animation-callbacks-web
Open

feat: web support for CSS animation callbacks#9605
MatiPl01 wants to merge 1 commit into
mainfrom
@matipl01/css-animation-callbacks-web

Conversation

@MatiPl01

@MatiPl01 MatiPl01 commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

Adds CSS animation event callbacks on web: onAnimationStart, onAnimationEnd, onAnimationIteration, onAnimationCancel, declared in style alongside the animation config. On web they map directly to the browser's native DOM animation events (zero JSI), scoped per-view: animation events bubble, so descendant animations are ignored, matching native's per-view model. The callback payload is { animationName, elapsedTime }.

Also warns in __DEV__ when animation callbacks are provided without any animation configured.

Native (iOS/Android) support is a follow-up.

Test plan

  • Unit tests for callback extraction, the dev warning, and the web manager's listener lifecycle, per-event dispatch, bubbling filter, latest-callback reuse and detach.
  • Verified in a real browser (Chromium) against the actual CSSManager: all four events deliver the correct { animationName, elapsedTime }, bubbling is scoped to the view, a negative animationDelay starts the animation mid-way (animationstart with elapsedTime == |delay|), and the animation longhands (delay, iteration-count, play-state) are written and cleared correctly.

Mirror the web CSS transition callbacks for animations: onAnimationStart, onAnimationEnd, onAnimationIteration and onAnimationCancel, declared in style and delivered from the DOM AnimationEvent with an { animationName, elapsedTime } payload. Warn in __DEV__ when animation callbacks are set without any animation.
@MatiPl01 MatiPl01 self-assigned this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant