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

layout calculations in beforeEnter hook will cancel entering animation for transition elements #7531

Closed
kingofwhales opened this issue Jan 25, 2018 · 5 comments · Fixed by #7823
Labels

Comments

@kingofwhales
Copy link

kingofwhales commented Jan 25, 2018

Version

2.5.13

Reproduction link

https://codepen.io/asiankingofwhales/pen/zpQBQM

Steps to reproduce

  1. Click Toggle Slide to enable transition, which is currently not working
  2. If you remove the scrollTop layout calculations in beforeSlideEnter, the element will slide in smoothly. Now the transition is working.

What is expected?

Gradual sliding in from right

What is actually happening?

With scrollTop calculations, the entering transition is gone.


I have found that wrapping the child component in an additional div will solve this problem. However, this seems like a hack.

I apologize if this is not a bug. I have raised this questions in forum, discord and stackoverflow but no one is able to answer. So I have started to think that it might be a bug.

Stackoverflow Link

https://stackoverflow.com/questions/48420077/beforeenter-hook-on-child-component-transition-cancelled-by-scrolltop-layout-cal

@posva
Copy link
Member

posva commented Jan 25, 2018

mmh, weird. We may be doing something wrong but here is a version without Vue (mimics what Vue does) that also fails but only on Chrome: http://codepan.net/gist/bf91a55172b1302acc2ade0681e9fbd3
I think that by doing a layout calculation, it may be enforcing the values too early and thus not triggering the transition

@kingofwhales
Copy link
Author

kingofwhales commented Jan 25, 2018

This is truly strange.. Maybe a chrome bug?

The vue example does have the same issue on safari and firefox. For now, my solution is just to wrap the child component in an additional div, which seems to solve the problem. But I wonder if this is a bug..

Solution: https://codepen.io/asiankingofwhales/pen/baPWYQ?editors=1010

@LinusBorg
Copy link
Member

maybe chrome just triggers a transitionend event when it does a layout calcultion?

@kingofwhales
Copy link
Author

The vue example isn't limited to chrome only though. It's happening in firefox and safari too.

Being able to solve this by wrapping the child component in another parent div makes me think that this might be a vue bug too.. For now, this is my solution..

@kingofwhales
Copy link
Author

kingofwhales commented Mar 13, 2018

thanks a lot!!!! 😝😝😝

感谢大神们!!!!!

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

Successfully merging a pull request may close this issue.

4 participants