SmallComfort/react-vue-loader

<transition> element is removed before `leave` handler's `done` callback is called

faceyspacey opened this issue · 1 comments

I found one more likely small issue related to basic <transition> usage:

The dom element is removed before the leave handler's done callback is called.

I have a demo you can easily try like this:

git clone https://github.com/faceyspacey/universal-demo
cd universal-demo
git checkout vue-loader
yarn
yarn start
# visit this URL: http://localhost:3000/Rudy

It's a demo of this code sample from the Vue docs:
https://vuejs.org/v2/guide/transitions.html#Dynamic-Transitions

what's wrong

You'll notice that as soon as this.show is set to false in the enter handler's animation complete callback, the element is immediately removed. The leave callback is still called, but it doesn't matter since it's already gone.

expected behavior

The expected behavior is that the element is not removed until the leave handler calls done.

And here's a PR that fixes this:

SmallComfort/react-vue#5