Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(modal): defer promise resolution until animation starts #3806

Closed
wants to merge 1 commit into from

Conversation

wesleycho
Copy link
Contributor

  • Defer resolution of modalInstance promise until the animation cycle starts

It turns out that the promise resolution completes before the animation cycle starts, so it is possible for DOM elements to become stranded if it is desired for the $scope passed in to be destroyed.

Plunker of fix in action here.

Fixes #3787

@wesleycho wesleycho added this to the 0.13.1 (Performance) milestone Jun 11, 2015
@chrisirhc
Copy link
Contributor

Hm.. testing this might be quite challenging. Perhaps add a test that the promises are resolved after the animation has ended?

@wesleycho
Copy link
Contributor Author

The promises do not resolve before the animation has ended - they just resolve after the animation starts.

- Defer resolution of modalInstance promise until the animation cycle starts
@wesleycho
Copy link
Contributor Author

I added tests for this case and rebased

chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this pull request Jul 4, 2015
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this pull request Jul 4, 2015
@wesleycho wesleycho deleted the fix/modal-gc branch August 2, 2015 07:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modal dialog does not disappear with 0.13 and Angular 1.3 when destroying a passed scope
2 participants