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

Element Anchoring Animation not starting #11681

Closed
geekuillaume opened this issue Apr 22, 2015 · 6 comments
Closed

Element Anchoring Animation not starting #11681

geekuillaume opened this issue Apr 22, 2015 · 6 comments

Comments

@geekuillaume
Copy link

Hello !
I'm trying to use the element anchoring feature of ng-animate 1.4 using ng-animate-ref.
When transitioning to another view, the element is not moving and the animation does not start.

Here is a JSFiddle of the example: https://jsfiddle.net/3eouz22z/3/ and below a gif of the issue.

Issue

I tried on Google Chrome 43.0.2357.18 beta (64-bit) on Linux and on Firefox 37.0.1 on Linux.

Thanks for your great work !

@Narretz
Copy link
Contributor

Narretz commented May 6, 2015

Can you please try with the latest snapshot? https://code.angularjs.org/snapshot/angular.js

@geekuillaume
Copy link
Author

I just tried and the same issue occurs https://jsfiddle.net/3eouz22z/4/

@Narretz
Copy link
Contributor

Narretz commented May 6, 2015

I think it's mainly a problem with your css code: https://jsfiddle.net/3eouz22z/5/

The trigger css class for anchor animations must be the class on your view + anchor:

.view-anchor {
    transition: 1s all linear;
}

while you had previously:
.video-thumbnail.ng-animate-anchor { transition: 1s all linear; }

@matsko
Copy link
Contributor

matsko commented May 6, 2015

Yes @Narretz is correct.

Here is a working version of your code:

http://plnkr.co/edit/NMvWx0NhGylfnRr887sC?p=preview

I've been thinking about this and I think it's best that we generate the -anchor suffix based on the shared classes on the element being transported instead of the container with the enter and leave animations instead. It's just something that comes to mind first when developing this.

@matsko
Copy link
Contributor

matsko commented May 6, 2015

@geekuillaume @Narretz now a combination of both the origin/destination element classes as well as the container classes are prefixed and applied to the anchor element. #11822

matsko added a commit to matsko/angular.js that referenced this issue May 6, 2015
…re retained

This patch ensures that all of the CSS classes that exist on both
anchor nodes (the nodes that contain a `ng-animate-ref` attribute)
are not removed from the cloned element during the anchor animation.
(Previously the `in` animation would accidentally remove the CSS
classes of the first element.)

Closes angular#11681
matsko added a commit to matsko/angular.js that referenced this issue May 6, 2015
…re retained

This patch ensures that all of the CSS classes that exist on both
anchor nodes (the nodes that contain a `ng-animate-ref` attribute)
are not removed from the cloned element during the anchor animation.
(Previously the `in` animation would accidentally remove the CSS
classes of the first element.)

Closes angular#11681
@matsko
Copy link
Contributor

matsko commented May 6, 2015

Actually, it's better that we stick 100% to using the ng-anchor CSS class to drive anchor animations from here on. Here is a PR for that: #11825

matsko added a commit to matsko/angular.js that referenced this issue May 7, 2015
…re retained

This patch ensures that all of the CSS classes that exist on both
anchor nodes (the nodes that contain a `ng-animate-ref` attribute)
are not removed from the cloned element during the anchor animation.
(Previously the `in` animation would accidentally remove the CSS
classes of the first element.)

Closes angular#11681
@matsko matsko closed this as completed in e001400 May 7, 2015
netman92 pushed a commit to netman92/angular.js that referenced this issue Aug 8, 2015
…re retained

This patch ensures that all of the CSS classes that exist on both
anchor nodes (the nodes that contain a `ng-animate-ref` attribute)
are not removed from the cloned element during the anchor animation.
(Previously the `in` animation would accidentally remove the CSS
classes of the first element.)

Closes angular#11681
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants