From 709b5fe93e7f4078fa914d7732a454cb0d8e15ab Mon Sep 17 00:00:00 2001 From: plamenamiteva Date: Mon, 4 Oct 2021 15:02:31 +0300 Subject: [PATCH] fix(overlay): implement removeModalClasses method #9882 --- .../src/lib/services/overlay/overlay.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/igniteui-angular/src/lib/services/overlay/overlay.ts b/projects/igniteui-angular/src/lib/services/overlay/overlay.ts index b9b0cd2f548..50e9f3b103c 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/overlay.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/overlay.ts @@ -411,9 +411,9 @@ export class IgxOverlayService implements OnDestroy { document, true, info.settings.target); - this.addModalClasses(info); if (info.settings.positionStrategy.settings.openAnimation) { this.buildAnimationPlayers(info); + this.addModalClasses(info); this.playOpenAnimation(info); } else { // to eliminate flickering show the element just before opened fires @@ -534,6 +534,7 @@ export class IgxOverlayService implements OnDestroy { return; } if (info.settings.positionStrategy.settings.closeAnimation) { + this.removeModalClasses(info); this.playCloseAnimation(info, event); } else { this.closeDone(info); @@ -887,6 +888,14 @@ export class IgxOverlayService implements OnDestroy { } } + private removeModalClasses(info: OverlayInfo) { + if (info.settings.modal) { + const wrapperElement = info.elementRef.nativeElement.parentElement.parentElement; + wrapperElement.classList.remove('igx-overlay__wrapper--modal'); + wrapperElement.classList.add('igx-overlay__wrapper'); + } + } + private buildAnimationPlayers(info: OverlayInfo) { if (info.settings.positionStrategy.settings.openAnimation) { const animationBuilder = this.builder.build(info.settings.positionStrategy.settings.openAnimation);