Skip to content

Commit

Permalink
fix(modal): fixed nested backdrop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lexasq committed Oct 16, 2024
1 parent 4c55d85 commit f82fee9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modal/bs-modal.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class BsModalService {
protected backdropRef?: ComponentRef<ModalBackdropComponent>;
private _backdropLoader: ComponentLoader<ModalBackdropComponent>;
private modalsCount = 0;
private lastHiddenId: number | string | undefined = 0;
private lastDismissReason?: string;

private loaders: ComponentLoader<ModalContainerComponent>[] = [];
Expand Down Expand Up @@ -83,6 +84,10 @@ export class BsModalService {
}

hide(id?: number | string) {
if (this.lastHiddenId === id) {
return;
}
this.lastHiddenId = id;
if (this.modalsCount === 1 || id == null) {
this._hideBackdrop();
this.resetScrollbar();
Expand Down

0 comments on commit f82fee9

Please sign in to comment.