Transitioning children elements
See original GitHub issueVue.js version
1.0.26
Reproduction Link
Steps to reproduce
- Click on the button to open the slider (OK)
- Click on the darkened zone on the left to close the slider (FAIL) -> The element is never removed. (We can’t click on the body anymore, in that case)
What is Expected?
The element should be removed after animation.
What is actually happening?
The element is not removed from the DOM. (afterLeave
is never called)
More details
Note: I had to add the CSS transition: all 2s;
to the class .slider-transition
. Otherwise VueJS doesn’t know about the transition time.
Improvement
I feel like the way I’m using the transition system is a bit “hacky” although I have no idea how to avoid it. Ideally I’d like to be able to call transitions as follow:
<div id="slider" v-if="opened">
<div id="slider-backdrop" @click="$emit('close')" transition="fade"></div>
<div id="slider-content" transition="slide"></div>
</div>
But the transition
attribute is only allowed at the v-if
level.
Did I miss something ? What do you think ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
html - How to add a CSS3 transition to a child element when ...
I have created a simple layout above that shows the concept of what I am trying to achieve. What I want to do...
Read more >Child Animations Have To Inherit Transition-Property In ...
As you can see, the static child elements, in AngularJS 1.2, basically has to inherit all transition-related values. AngularJS 1.4 makes this a ......
Read more >HTML : CSS transition on child element where parent toggles ...
HTML : CSS transition on child element where parent toggles display property [ Beautify Your Computer ...
Read more >Key Elements of Early Transition - Texas Education Agency
This document provides a framework of the key elements of early transition to assist LEAs and ECI contractors in developing a collaborative child...
Read more >CSS transition animation fails when parent element changes ...
I wanted to change parent node position from static to fixed and at the same time animate some properties of child element using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is a “trick” I found to make it work : http://jsfiddle.net/0gmusue5/1/
The solution is still to add a false transition to the VueJS transitioned element and add a false attribute
opacity: 0.999
to make it work (opacity: 1
doesn’t work, I guess there needs to be a transition in a way). It still feels like a hack to me. Any advice or opinion about this ?This will be a wontfix in 1.x, and should be addressed in 2.x via the ability to explicitly declare transition durations (#4371)