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 mode for transition-group

See original GitHub issue

The standalone demo repo https://github.com/rightaway/demo shows the issue. If you click the message1 button once and then click it again, the second message1 notification appears and then the first one disappears. This is what mode=out-in is meant to solve for the transition tag, but there’s no equivalent for transition-group. It leads to a very unattractive transition effect.

In this example I could use transition mode="out-in" instead of transition-group (in https://github.com/rightaway/demo/blob/master/src/Notify.vue#L3) except for the fact that if you click the message1 button and then the message2 button, Vue gives an error saying I need to use transition-group.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:23
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

24reactions
NonPolynomialcommented, Jul 4, 2017

I know thats just a workaround, but you could use the CSS transition-delay

  • for mode out-in use the enter-active class
  • for mode in-out use the leave-active class

e.g.

.slider-item {
  display: inline-block;

  &.slider-enter-active,
  &.slider-leave-active {
    transition: opacity .3s;
  }

  &.slider-enter-active {
    transition-delay: .5s;
  }

  &.slider-enter,
  &.slider-leave-to {
    opacity: 0;
  }
}
11reactions
yyx990803commented, Jul 19, 2017

This is unlikely to happen due to the sheer complexity - it will likely introduce too much extra code for a relatively non-critical use case, and the behavior of the transition modes on multiple items can be vague and hard to define. Even if we were to implement it, we’d probably ship it as a separate plugin instead of as part of core.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TransitionGroup | Vue.js
By default, it doesn't render a wrapper element. · Transition modes are not available, because we are no longer alternating between mutually exclusive...
Read more >
vue transition-group - how to prevent both elements from ...
vue transition-group - how to prevent both elements from reserving space in mode=out-in · css · vue.js · transition.
Read more >
How to Add Animations with React Transition Group
Assuming you have a React app already initialized, let's first install the react-transition-group package using the line below.
Read more >
Animating React with React Transition Group - Bits and Pieces
Let's move on now to React Transition Group's next option: ... Based on the selected mode ( in-out or out-in ), and the...
Read more >
Vue Group Transitions - RIMdev
The mode="in-out" tells Vue to let the existing dom element to finish it's transition ... but Vue doesn't use that in transition-group ....
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