Skip to content

Commit

Permalink
fix(core): remove OnPush from dialog container
Browse files Browse the repository at this point in the history
  • Loading branch information
mikerodonnell89 committed Oct 10, 2024
1 parent 104e1f5 commit 95b9e15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
14 changes: 1 addition & 13 deletions libs/core/dialog/dialog-container/dialog-container.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { AnimationEvent } from '@angular/animations';
import {
AfterContentChecked,
AfterViewInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentRef,
Expand Down Expand Up @@ -41,13 +39,12 @@ import { dialogFade } from '../utils/dialog.animations';
styleUrl: './dialog-container.component.scss',
animations: [dialogFade],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [PortalModule]
})
export class DialogContainerComponent
extends DynamicComponentContainer<DialogContentType>
implements DialogContainer<any>, AfterViewInit, AfterContentChecked, CssClassBuilder
implements DialogContainer<any>, AfterViewInit, CssClassBuilder
{
/** Custom classes */
@Input()
Expand Down Expand Up @@ -109,13 +106,6 @@ export class DialogContainerComponent
});
}

/** @hidden */
ngAfterContentChecked(): void {
if (this.portalOutlet) {
this._cdr.markForCheck();
}
}

/** @hidden */
protected _attached(event: CdkPortalOutletAttachedRef): void {
if (event instanceof ComponentRef) {
Expand All @@ -138,7 +128,6 @@ export class DialogContainerComponent
this._createFromDefaultDialog(this.childContent);
}
this._animationStateSignal.set('visible');
this._cdr.detectChanges();
}

/** @hidden Returns context for embedded template*/
Expand All @@ -161,7 +150,6 @@ export class DialogContainerComponent
private _listenOnClose(): void {
const callback: () => void = () => {
this._animationStateSignal.set('hidden');
this._cdr.detectChanges();
};
this.ref.afterClosed.pipe(takeUntilDestroyed(this._destroyRef)).subscribe({
next: () => callback(),
Expand Down
4 changes: 3 additions & 1 deletion libs/core/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ export class DialogComponent
/** @hidden */
ngOnDestroy(): void {
super.ngOnDestroy();
this._onHidden.unsubscribe();
if (this._onHidden) {
this._onHidden.unsubscribe();
}
}

/** @hidden */
Expand Down

0 comments on commit 95b9e15

Please sign in to comment.