Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(overlay): Fixes an issue with afterExit not being called when the…
Browse files Browse the repository at this point in the history
… overlay closes on scroll.
  • Loading branch information
nimrod13 authored and tomheller committed Feb 7, 2022
1 parent fa118e8 commit ddd567b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/barista-components/overlay/src/overlay-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
ViewContainerRef,
ViewEncapsulation,
isDevMode,
OnDestroy,
} from '@angular/core';

import {
Expand Down Expand Up @@ -111,7 +112,7 @@ export const _DtOverlayContainerMixin = mixinNotifyDomExit(
})
export class DtOverlayContainer
extends _DtOverlayContainerMixin
implements CanNotifyOnExit
implements CanNotifyOnExit, OnDestroy
{
/** @internal */
@ViewChild(CdkPortalOutlet, { static: true }) _portalOutlet: CdkPortalOutlet;
Expand All @@ -136,6 +137,10 @@ export class DtOverlayContainer
super(_ngZone);
}

ngOnDestroy(): void {
this._notifyDomExit();
}

/**
* Attach a ComponentPortal as content to this overlay container.
*/
Expand Down

0 comments on commit ddd567b

Please sign in to comment.