angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.27k stars 6.73k forks source link

Multiple Modals and Backdrop #2678

Open Exagram opened 10 years ago

Exagram commented 10 years ago

If I open a modal within a modal, a new backdrop doesn't instantiate for the second modal. Does Angular UI support this use case? If not, is there an option to move the backdrop to the highest modal?

davidwparker commented 10 years ago

Everything that I've seen is that they re-use the backdrop when possible. This is convenient for not creating objects, but not convenient for doing things with different backdrop styles...

Exagram commented 10 years ago

I'm not trying to use different backdrop styles, I'm trying to make sure that "a" or "the" backdrop is under the top-most modal. This doesn't happen if you open a modal on a modal.

Example: D | D | bD or D | bD | bD Where b=backdrop, D=dialog

borislit commented 9 years ago

+1 In my case, I have closed one modal (lets call it Modal A) and immedialtly opened another one (lets call it Modal B). Modal A has a backdropClass defined for it. When modal B is opened, the backdropClass is not removed.

karianna commented 9 years ago

plunkr to demonstrate please

borislit commented 9 years ago

http://plnkr.co/edit/KCBVGVzirLlApozRrbjl

The flow is as follows: Once you open the first modal, clicking OK will close it and will open the second one right away. Notice that the first modal adds a "custom-backdrop" class which is not removed when the second modal opens.

rosskukulinski commented 9 years ago

So we've run into this as well. I'm still poking around, but it seems that there's a race condition from closing the first modal (and removing its backdrop) and setting the backdrop of the second modal.

Specifically, I'm seeing that backdropDomEl is non-null right here, which means that the second modal does not get its backdrop applied.