Vue: Transition class `leave-to` not removed if hidden element changes too fast with v-show

Created on 6 Mar 2018  ·  5Comments  ·  Source: vuejs/vue



Reproduction link

Steps to reproduce

change a value in a vue really fast and the transition won't remove the leave-to class

What is expected?

the label should be shown

What is actually happening?

the label isn't shown

On my own app, i redirected to a page that was supposed to have no app header, but it then redirected to another page that did, but the header was missing anyway


All 5 comments

As a workaround for the moment you can use a v-if instead of the v-show

for the moment i just debounced it and used a local property

    async "$store.state.invisible"() {
      this.__updateInvisible = setTimeout(() => {
        this.invisible = this.$store.state.invisible;
      }, 50);

that works for me, i just wanted to let you know about the bug

Oh, yeah, I didn't even check the code to see it was a v-show because it's a transition-group so I was expecting it to only do a v-for. Seems related but may be caused by different things, so I think we can keep it open for the moment

This has been fixed by #7391 (not released yet)

Was this page helpful?
0 / 5 - 0 ratings