diff --git a/src/app/components/overlaypanel/overlaypanel.ts b/src/app/components/overlaypanel/overlaypanel.ts index c1e28583eb1..d182df038a8 100755 --- a/src/app/components/overlaypanel/overlaypanel.ts +++ b/src/app/components/overlaypanel/overlaypanel.ts @@ -230,10 +230,10 @@ export class OverlayPanel implements AfterContentInit, OnDestroy { const documentTarget: any = this.el ? this.el.nativeElement.ownerDocument : this.document; this.documentClickListener = this.renderer.listen(documentTarget, documentEvent, (event) => { - if (!this.container?.contains(event.target) && this.target !== event.target && !this.target.contains(event.target)) { + if (!this.container?.contains(event.target) && this.target !== event.target && !this.target.contains(event.target) && !this.selfClick) { this.hide(); } - + this.selfClick = false; this.cd.markForCheck(); }); }