Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out transition not working when nesting component w/ render function #8648

Closed
jpdombrowski opened this issue Aug 13, 2018 · 3 comments
Closed

Comments

@jpdombrowski
Copy link

Version

2.5.17

Reproduction link

https://jsfiddle.net/eywraw8t/265765/

Steps to reproduce

Push button, wait for fade in. Push button again.

What is expected?

Elements fade in on first click and fade out on second click.

What is actually happening?

Transitioning in works fine.
On transitioning out transition classes are applied if rendering of transitions's child node is controlled by a v-if directive, but fail to be applied when rendering is controlled by child components render() function.


I don't know if this is expected behaviour or if I'm overlooking something obvious, but it feels like both cases should behave identical, since the documentation explicitly states v-if is implemented via JS if-statements within render functions.

@posva
Copy link
Member

posva commented Aug 13, 2018

See #3431 (comment)

@posva posva closed this as completed Aug 13, 2018
@jpdombrowski
Copy link
Author

Thanks for pointing that out! Couldn't find it.

Here is an updated fiddle showcasing both use cases: https://jsfiddle.net/eywraw8t/265969/

This was really quite the gotcha though :).
And it feels a little bit unfortunate when transitions are supposed to be optional in your use case and you're after highly decomposed components.

@posva
Copy link
Member

posva commented Aug 13, 2018

you can also put the transition inside of the component and wrap your root element with it only if a prop transition is provided 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants