migrating onAbort fix from wow-libs + tests#163
Conversation
|
|
||
| async onAbort(callback: () => void): Promise<void> { | ||
| try { | ||
| await Promise.all(this.animations.map((animation) => animation.finished)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}) ?
There was a problem hiding this comment.
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?
Description
Related Issue
Checklist
Screenshots / Demos
Additional Notes