-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
Transition leave-active-class not working #117
Comments
Hi @emilz0r , well it is actually as expected if you think about it. What So, you click your slide button which sets the condition to true. The chart get's created and mounted and because of the transition animated. If you click it again, the You can however use |
@apertureless Huh, I thought that I'd checked v-show, but it works:) What's a little strange is that it works with v-if if there is no chart in the component, and also with the chart you can see the scrollbar slowly get smaller before it disappears. Well it works with v-show, so thanks a bunch! |
Well not strange at all. If you put a component in a v-if it will get destroyed properly. The problem with that is, that your component gets destroyed before the transition finishes. |
I updated the codepen ( https://codepen.io/anon/pen/zzOXjm ) to not extend the chart, and now the animation runs before destroying the component. Should it still get destroyed before the transition finishes with this setup also, by your definition? |
Is it because the chart is rendered on mount with the chart, and not by the template definition? |
I thought that the transition component sniffed for css transitions, and then waited for the amount of time that the css transition is set to take before destroying. |
It is a bit tricky, tho because Chart.js is not "native" Vue. It is a third party lib, which works on the canvas and has it's own lifecycle. If you add the Which is important, otherwise you could have multiple instances of the chartjs instance, which led to bugs and unwanted behavior. |
I see. Thanks for your replies, and thanks for making this great repo:) |
Expected Behavior
Expected animation to fire before removing line-chart
Actual Behavior
line-chart goes blank for as long as the animation should have lasted then gets removed
codepen
https://codepen.io/anon/pen/zzOXjm
notes
The text was updated successfully, but these errors were encountered: