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

enter/leave events not fired in certain circumstances with ng-repeat (animated content outside app root) #12617

Closed
wesleycho opened this issue Aug 18, 2015 · 7 comments

Comments

@wesleycho
Copy link
Contributor

I am not sure if this is reproducible with the other directives like ng-if or ng-show/ng-hide, but there was a bug reported in angular-ui/bootstrap#4222 where it turns out the events are not fired, nor the animation running - here is a reproduction where it works normally for a defined JavaScript animation with jQuery with ng-repeat, but inside the modal element, it does not log any output.

@Narretz
Copy link
Contributor

Narretz commented Dec 2, 2015

That's because the modal is outside of the ng-app root element. In that case ngAnimate cannot detect if animations are defined. I'm not sure if this is intentional, or if it should work.

@Narretz
Copy link
Contributor

Narretz commented Dec 2, 2015

There's the $animate.pin API for that. You should call that after the modal element has been added to the DOM. However, it's currently broken, I'm looking into it.

@wesleycho
Copy link
Contributor Author

Hm, so would you say that it is highly recommended to have the app bootstrapped on body or a higher element? I typically just do angular.bootstrap(document, [...]) myself.

@Narretz
Copy link
Contributor

Narretz commented Dec 2, 2015

It's always the best bet. But once $animate.pin is fixed, bootstrap ui should use it inside the modal function and pin the modal to the $rootElement. Bascically, all libraries that add fragment DOM like this should do it, to be one the safe side.

@gkalpak
Copy link
Member

gkalpak commented Dec 7, 2015

Something to keep in mind wrt $animate.pin() is that it is not available prior to v1.4, so if you have a version of a library that tries to be compatible with angular v1.3+, it might be a problem.

Just a heads up...

@wesleycho
Copy link
Contributor Author

Got it - we are about to drop 1.3 support in our next release, so that shouldn't be an issue.

@Narretz Narretz self-assigned this Dec 8, 2015
@Narretz Narretz changed the title enter/leave events not fired in certain circumstances with ng-repeat enter/leave events not fired in certain circumstances with ng-repeat (animated content outside app root) Dec 8, 2015
Narretz added a commit to Narretz/angular.js that referenced this issue Dec 8, 2015
Narretz added a commit to Narretz/angular.js that referenced this issue Dec 8, 2015
Narretz added a commit to Narretz/angular.js that referenced this issue Dec 10, 2015
Previously, the animate queue would only detect pinned elements when
they were the same element as the to-be-animated element.

Related angular#12617
Closes angular#13466
Narretz added a commit to Narretz/angular.js that referenced this issue Dec 10, 2015
Previously, the animate queue would only detect pinned elements when
they were the same element as the to-be-animated element.

Related angular#12617
Closes angular#13466
Narretz added a commit that referenced this issue Dec 10, 2015
Previously, the animate queue would only detect pinned elements when
they were the same element as the to-be-animated element.

Related #12617
Closes #13466
Narretz added a commit that referenced this issue Dec 10, 2015
Previously, the animate queue would only detect pinned elements when
they were the same element as the to-be-animated element.

Related #12617
Closes #13466
@Narretz
Copy link
Contributor

Narretz commented Dec 10, 2015

The fixes to pin() have landed in master (8f0b482) and 1.4.8 (1329e0f) and will be available in 1.5.0 and 1.4.10.

@Narretz Narretz closed this as completed Dec 10, 2015
Narretz added a commit that referenced this issue Dec 14, 2015
Previously, the animate queue would only detect pinned elements when
they were the same element as the to-be-animated element.

Related #12617
Closes #13466
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