Skip to content

Transition's @appear hook invoked even when appear not specified / falsy #9320

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

Open
pkaminski opened this issue Jan 14, 2019 · 3 comments
Open

Comments

@pkaminski
Copy link
Contributor

Version

2.5.22

Reproduction link

https://codepen.io/anon/pen/jXdLGV

Steps to reproduce

Open the repro and note that the rendered page says "initial appear".

What is expected?

The @appear hook should not be invoked and the page should just say "initial".

What is actually happening?

The @appear hook is invoked even though the transition doesn't have an appear attribute, and hence shouldn't be triggering on appear. The same thing happens if you add :appear ="false" to the transition.


Ran into this when building some custom transition components where appear should be user-controlled, but was being invoked all the time instead.

@posva
Copy link
Member

posva commented Jan 15, 2019

It's also worth noting that we could improve the docs in this matter: https://vuejs.org/v2/guide/transitions.html#Transitions-on-Initial-Render

I'm not sure what is exactly expected here, but I would also say no appear events if appear=false. It seems there is a done callback to it

@Itisfilipe
Copy link

Hey guys! I am learning this code base so I have implemented a fix for that without knowing if that would be ever needed, feel free to review it if you find it useful or disregard if not. Thanks!

@shasharoman
Copy link
Contributor

I think this is not a code bug, but the document needs to be described more clearly.

Both appear attribute and @appear hook will cause an appear transition, and @appear hook will have a higher priority. If you don't want an appear transition, don't specify @appear hook. Because @appear hook has a higher priority, using :appear=false does not cancel the transition.

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

Successfully merging a pull request may close this issue.

5 participants