-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make hover animation work #6129
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@nagix good catch. I think it's negligible but did you profile the performance hit of this final clone? |
Looks great @nagix. Great catch! |
This clone with 47 properties always finishes in less than 0.2ms and is called once per animation, so I don't think it impacts the performance. |
...But let me check a chart with more data points as this could impact all the elements. |
This is the
|
The overhead of the clone was not small as expected. Another option would be to clone The downside is that it is not guaranteed that |
The duration of
|
570633c
Now it just uses |
Reverted the previous change as |
Would |
Or would |
|
Here is another run.
As far as I know, |
I'm guessing that
That loops over multiple inputs does a function call per key. I'm guessing it'd be much faster to do something like:
Or potentially faster still:
|
Element._model
has to be cloned toElement._view
whenElement.transition(1)
is called. Otherwise, when_model.*
is set on hover,_view.*
is also set to the same value, and an animation doesn't occur.This PR makes makes hover animation work.
Master: https://jsfiddle.net/nagix/gL0sebrh/
This PR: https://jsfiddle.net/nagix/bjhp163w/
Fixes #5691