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

fix(transition): looking up context of transition #9668

Merged
merged 5 commits into from
Mar 14, 2019
Merged

fix(transition): looking up context of transition #9668

merged 5 commits into from
Mar 14, 2019

Conversation

shasharoman
Copy link
Contributor

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:
fixed #9628
Transition inside child component with v-if should be no enter-transition, it depend on appear attribute.

@shasharoman
Copy link
Contributor Author

This pull request is also fixed #9364.

@shasharoman
Copy link
Contributor Author

The test-e2e failed, I thought it was a problem with CircleCI, so I ignored it. Today I found that the test case was not updated. But also found some other hidden dangers, this PR does not seem to be compatible with the previous version, suppose there is a component of my-transition, his template is <transition><div>xxx</div></transition>, if used like this:

<my-transition v-if="showing"></my-transition>

When showing is changed from false to true, the previous version will have a transition effect, but the new PR will result in having to specify an appear attribute for the transition to have a transition effect.

@katerlouis
Copy link

I disagree with that this change is not breaking things.
Yeah, the app builds etc.

But enter animations aren't called without applying appear inside a transition wrapping inside a component. Sure, just add appear – problem now is that the component's enter animation is triggered on first load also, which is not what I want.

See this issue: #10227

@mrleblanc101
Copy link

mrleblanc101 commented Apr 9, 2021

@yyx990803 @shasharoman

Just found an example on the web while trying to understand how to use transition as the root element of my component.
I was wondering why the codepen example worked, but not in my project !
The example use Vue 2.6.4 which was before this patch was merged.

Vue 2.6.4: https://codepen.io/tahazsh/pen/mvKjbq
Vue 2.6.9+: https://codepen.io/mrleblanc/pen/eYgyZqR

I think the documentation should be improved on how to handle transition when they are on root element.
Currently if you do not specify appear, the leave transition work, but not the enter transition.
All example on the doc use regular HTML and not components which mean we have to guess this behavior.
Also it seems odd that we need appear when <v-transition> is at the root, it think there should be an exception for this behavior.

If you agree, I can open a new issue and reference this PR.

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

Successfully merging this pull request may close these issues.

Transition component animates when wrapper is replaced
4 participants