Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Why does ngView add the new element before the previous element when animating? #4362

Closed
Siyfion opened this issue Oct 10, 2013 · 3 comments
Closed

Comments

@Siyfion
Copy link

Siyfion commented Oct 10, 2013

This seems like it's completely the wrong way around to me, if you want to do a simple fadeOut -> fadeIn animation, you can't get it to look good because the new view pushes the old view down instantly.

I guess you could change the animation to a keyframed anim and set display: none until it starts, but it's a bit overkill..?

@ghost ghost assigned matsko Oct 10, 2013
@petebacondarwin
Copy link
Member

If you are doing fade animations then you would need the new element to be hidden initially either way, no?

Even if it was add after the old element, without display: none, it would appear below the old one.

@matsko
Copy link
Contributor

matsko commented Oct 10, 2013

It does this because the previous scope+element gets cleaned up (scope destroyed + leave animation), and then by the time the enter animation occurs it uses the transclusion anchor as the previous sibling. This is set like this because if there are no animations then the leave element is gone by the time the enter insertion comes up and it has no element to insert after (aside from the transclusion anchor). This should be changed though.

@matsko
Copy link
Contributor

matsko commented Oct 17, 2013

Waiting for the PR to be merged.

matsko added a commit to matsko/angular.js that referenced this issue Oct 23, 2013
@matsko matsko closed this as completed in 3f568b2 Oct 23, 2013
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.