Skip to content

Commit b38db2a

Browse files
Martin Cavojvalorkin
authored andcommitted
fix(modal): Call hideModal in ngOnDestroy if modal is shown (#1038)
fixes #853, fixes #1051, closes #1052
1 parent 26d9209 commit b38db2a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/modal/modal.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ export class ModalDirective implements AfterViewInit, OnDestroy {
9999
// this._element = null
100100
// this._dialog = null
101101
// this._backdrop = null
102+
if (this._isShown) {
103+
this._isShown = false;
104+
this.hideModal();
105+
}
102106
this._isShown = void 0;
103107
this.isBodyOverflowing = void 0;
104108
this.originalBodyPadding = void 0;

0 commit comments

Comments
 (0)