question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow nested transition to trigger upon removal

See original GitHub issue

Version

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:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
posvacommented, Jan 16, 2019

it could be via a new prop on transition I think 🤔 . I haven’t checked the feasibility though although it should be possible

2reactions
damtsnkffcommented, Jul 23, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found