Closed Aiving closed 1 month ago
Hey, by just looking at the code I would say that the animation is not starting because the same signal it depends (info) has a new value at the same time you are starting it. This seems like a common case so I'll see what I can do about it.
I fixed it using use_effect
(also added RippleState
).
However, now there is one problem and one question.
Problem: for some reason, the mouseleave
(or pointerleave
) event is not emitted.
Question: Is there a way to track when the animation ends and then do something?
Problem: for some reason, the mouseleave (or pointerleave) event is not emitted.
For the leave events to be emitted you need to also register a mouseenter or pointerenter event, you can leave it empty but it's how currently freya detects that an element is interested in the "leave" event. I plan to improve this at some point
Question: Is there a way to track when the animation ends and then do something?
You can use a use_effect or use_memo, call !animations.is_running() && animations.has_run_yet()
Thanks!
While continuing to try to implement the ripple effect from Material Design (which I mentioned in #767), I came across the fact that
animations.start()
doesn't seem to do anything. Obviously, this has something to do with theinfo
variable and probably thepointerdown
closure. However, I have not found out the exact reason why this is happening.Branch:
fix/element-rendering-rethink
It is quite difficult for me to provide the minimum code to reproduce the problem, so below will be all the code I am currently using: