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

Modal open calls should resolve in order #2404

Closed
nlwillia opened this issue Jun 28, 2014 · 1 comment
Closed

Modal open calls should resolve in order #2404

nlwillia opened this issue Jun 28, 2014 · 1 comment

Comments

@nlwillia
Copy link

Modal instances should be added to the stack in the same order as their $modal.open calls. Currently, due to template and resolve resolution, modal instances are added in the order that the promises they depend on are fulfilled. This can be a problem if modals are linked to router states and a series of nested modals each with its own deferred dependencies is launched by a deep state link. The resulting display layer order should be deterministic, but instead it is dependent on which promises resolve first.

Here is a demo of the problem in action. The modals are opened in order from 1-3, but the resolve order is 3-1 and modal 1 ends up on top of the stack instead of the bottom.

When opening a new modal, its promises should be chained off the promise of the previous modal opened so that no modal is added to the stack until all of its predecessors have successfully resolved.

nlwillia pushed a commit to nlwillia/bootstrap that referenced this issue Jul 11, 2014
Modal open calls wait on template and resolve promises.  Even though the
resolution order of the promises among different modals is
non-deterministic, the open calls should complete in the same order they
were invoked.
@nlwillia
Copy link
Author

I've submitted #2443 with a test case and fix.

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