Skip to content

migrating onAbort fix from wow-libs + tests#163

Merged
ameerabuf merged 5 commits intomasterfrom
migrating_fixes
Mar 18, 2026
Merged

migrating onAbort fix from wow-libs + tests#163
ameerabuf merged 5 commits intomasterfrom
migrating_fixes

Conversation

@ameerabuf
Copy link
Contributor

Description

Related Issue

Checklist

  • I have read the Contributing Guide
  • I have added/updated tests for my changes (if applicable)
  • I have updated documentation/rules/skills (if applicable)

Screenshots / Demos

Additional Notes


async onAbort(callback: () => void): Promise<void> {
try {
await Promise.all(this.animations.map((animation) => animation.finished));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to simulate the animationcancel event and dispatch a on the target element if we're on !this.isCSS mode like above in onFinish.
Also, if we have all this logic duplicated for finish and abort, maybe we should refactor this? Just a thought.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any suggestion how? I kind of like how it is now where you can register multiple ones and it will still work and they do not override each other. Maybe hookCallbacks({finish: () => void; abort: ()=> void}) ?

Copy link
Contributor Author

@ameerabuf ameerabuf Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the animationcancel event.. actually if we are trying to simulate these events, maybe we should not depend on externally calling onAbort or onFinish?
Maybe the correct approach is to dispatch the events and only that as the API of AnimationGroup, and have eventHandlers in Interact?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's leave for now

@ameerabuf ameerabuf enabled auto-merge (squash) March 17, 2026 20:15
@ameerabuf ameerabuf requested a review from ydaniv March 17, 2026 20:15
@ameerabuf ameerabuf merged commit 997e0cb into master Mar 18, 2026
1 check passed
@ameerabuf ameerabuf deleted the migrating_fixes branch March 18, 2026 10:33
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.

2 participants