valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.53k stars 1.69k forks source link

backdrop issue with nested modals #6686

Open SusanneEmineo opened 6 days ago

SusanneEmineo commented 6 days ago

Bug description:

When working with nested modals, the backdrop disappears when the first modal is hidden, even though there are still modals open. Following disappears in the html, thus the background blurring is lost: <bs-modal-backdrop class="modal-backdrop fade show"></bs-modal-backdrop>

The issue is actually visible in the demo of the current ngx-bootstrap version: https://valor-software.com/ngx-bootstrap/#/components/modals#service-nested: Open first modal -> Open second modal -> Close self / Close first modal (in either case)

I tried a manual workaround counting levels of modals and calling this.bsModalService._showBackdrop(); in case there are still modals open, but that does not work.

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 18.0.2

Angular: 18.2.0

Bootstrap: 5.3.3

Build system: Angular CLI

Expected behavior

I expect the backdrop to remain until the last modal ist hidden.

dur00s commented 5 days ago

Experiencing the same, only difference is that we are using Angular 18.1.0

rogerwilcos83 commented 5 days ago

I can confirm I have the same issue. I am on ngx-bootstrap 18.0.2, angular 18.2.5. Any workaround would be appreciated if available.