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.29k stars 6.73k forks source link

uibModal with backdrop:false moves the backdrop up the stack if there is a modal with backdrop already open #6507

Open phrough opened 7 years ago

phrough commented 7 years ago

Bug description:

If a modal with a backdrop is already open on the page and an additional modal with backdrop: false is opened, the backdrop is moved up the stack and placed under the new modal. Ideally, opening a modal with backdrop: false would not affect the z-index of an existing backdrop.

Link to minimally-working plunker that reproduces the issue:

https://plnkr.co/edit/vAtlcxQULYVqXEhyzr9F?p=preview

Steps to reproduce the issue:

1) Open a uibModal with a backdrop 2) Open an additional uibModal without a backdrop 3) Observe the backdrop moves up the stack and behind the new modal

Version of Angular, UIBS, and Bootstrap

Angular: 1.6.1

UIBS: 2.5.0

Bootstrap: 3.3.7

phrough commented 6 years ago

Removing the following block from modal.js backdropIndex() will fix this issue.

        // If any backdrop exist, ensure that it's index is always
        // right below the top modal
        if (topBackdropIndex > -1 && topBackdropIndex < topModalIndex) {
          topBackdropIndex = topModalIndex;
        }