diff --git a/src/modal/bs-modal.service.ts b/src/modal/bs-modal.service.ts index a5a253b24a..490bf2b4cd 100644 --- a/src/modal/bs-modal.service.ts +++ b/src/modal/bs-modal.service.ts @@ -42,6 +42,7 @@ export class BsModalService { protected backdropRef?: ComponentRef; private _backdropLoader: ComponentLoader; private modalsCount = 0; + private lastHiddenId: number | string | undefined = 0; private lastDismissReason?: string; private loaders: ComponentLoader[] = []; @@ -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();