Skip to content

Commit

Permalink
fix(overlay): wrap class addition in RAF #9882
Browse files Browse the repository at this point in the history
  • Loading branch information
PlamenaMiteva committed Oct 7, 2021
1 parent 50d4ccb commit d019881
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions projects/igniteui-angular/src/lib/services/overlay/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class IgxOverlayService implements OnDestroy {
* }
* ```
*/
public contentAppended = new EventEmitter<OverlayEventArgs>();
public contentAppended = new EventEmitter<OverlayEventArgs>();

/**
* Emitted just before the overlay animation start.
Expand Down Expand Up @@ -707,7 +707,9 @@ export class IgxOverlayService implements OnDestroy {
// to eliminate flickering show the element just before animation start
info.wrapperElement.style.visibility = '';
info.visible = true;
this.addModalClasses(info);
requestAnimationFrame(() => {
this.addModalClasses(info);
});
info.openAnimationPlayer.play();
}

Expand Down Expand Up @@ -923,7 +925,7 @@ export class IgxOverlayService implements OnDestroy {
}
}

private openAnimationDone(info: OverlayInfo){
private openAnimationDone(info: OverlayInfo) {
this.opened.emit({ id: info.id, componentRef: info.componentRef });
if (info.openAnimationPlayer) {
info.openAnimationPlayer.reset();
Expand All @@ -939,7 +941,7 @@ export class IgxOverlayService implements OnDestroy {
}
}

private closeAnimationDone(info: OverlayInfo){
private closeAnimationDone(info: OverlayInfo) {
this.closeDone(info);
if (info.closeAnimationPlayer) {
info.closeAnimationPlayer.reset();
Expand Down

0 comments on commit d019881

Please sign in to comment.