question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support animation events

See original GitHub issue

The event handlers look like as following

div(
  onAnimationStart --> ...,
  onAnimationonIteration --> ...,
  onAnimationEnd --> ...,
)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
raquocommented, Dec 23, 2020

btw, forgot to mention in case anyone does something like this.

In the example above, for removeEventListener to work, you need to define your def handleAnimationEnd as a val handleAnimationEnd: js.Function1[dom.AnimationEvent, Unit] instead.

Otherwise, because addEventListener and removeEventListener accept js.Function1, this conversion from a Scala method to to js.Function1 will happen implicitly at the two usage sites of your handleAnimationEnd, and each of those conversions will create a new instance of js.Function1. So when you call removeEventListener, you will be passing a newly created instance of js.Function1 that has not been added as a listener, so the callback that was added previously will not be removed. This would become apparent if you tried to re-mount the component later, as you’d now have two callbacks registered that do the same thing twice.

Hope that makes sense. Just a small scala-js interop hiccup. When using Laminar methods (–>) you don’t have to worry about this.

1reaction
nghuuphuoccommented, Dec 23, 2020

I am going to create the PR 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Animation Events - Unity - Manual
Use Animation Events to call functions at specific points in the timeline. These functions can be in any script attached to the GameObject....
Read more >
AnimationEvent - Web APIs | MDN
Chrome Edge AnimationEvent Full support. Chrome43. more. Toggle history Full support. Ed... AnimationEvent() constructor Full support. Chrome43. Toggle history Full support. Ed... animationName Full support. Chrome43....
Read more >
Unity tip of the day: Animation events | by Mohamed Hijazi
Animation events are basically allows you to call a function or method directly from the animation clip at a specific frame/time that you...
Read more >
CSS Animation Events | kirupa.com
The only event you can always rely on is the animationstart event. Your animationteration event will start firing at the beginning of your...
Read more >
Top 10 Annual Animation Events That Animators Should Attend
Animation events are simply programs, conferences, or workshops that provide information related to the animation industry. The ideas shared in these events ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found