Allow nested transition to trigger upon removal
See original GitHub issueVersion
2.5.22
Reproduction link
https://jsfiddle.net/wx91uLft/ other: https://jsfiddle.net/ae82rfnv/
Steps to reproduce
- Show/hide elements with the “Toggle” button.
- Show/hide elements with the “Toggle Ticked” button. Shows a workaround.
What is expected?
All transitions should be triggered on leave, even for nested child elements.
What is actually happening?
Transition classes don’t get applied to nested child elements, when conditions for leaving transitions occur on the same tick.
Workaround: Delaying the parent transitions by one tick fixes the problem.
This has been reported, but got closed due to the sample code did not use appear
on the <transition>
elements. (See issues #7643 and #9243)
My example is more detailed and also provides a workaround.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
triggering appearance/removal transitions in deeply nested ...
I know that SwiftUI can animate the conditional placement of a view inside another one like so if condition { MyView().transition(.opacity) }.
Read more >Different nested transitions not working as expected, only root ...
uikid commented on Feb 14, 2018. @posva thanks, but this is not working when used inside a single file component, same code.
Read more >How to Apply Nested Transitions in Vue | by Taha Shashtari
Animating an element when showing or hiding it is pretty easy in Vue — you just have to wrap the element with the...
Read more >Allow nested components to trigger parent component states
Currently, a nested components cannot trigger a component state. You would have to ungroup it, so that it is no longer a component...
Read more >Orchestrating Nested Transitions in Vue.js with Headless UI ...
... you how the Transition component in Headless UI makes it easy to transition multiple elements with different animations based on the...
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
it could be via a new prop on transition I think 🤔 . I haven’t checked the feasibility though although it should be possible
For future reader, @posva is right, we can achieve that via props.
I made a quick example here for the matter. I used
@before-leave=""
to trigger the parent transition (change of state), and@before-enter=""
on the parent, to trigger the animation on the child element.