From e42a2eae5989ecf2b5f0307005d0eade05658a26 Mon Sep 17 00:00:00 2001 From: pete-mcwilliams Date: Sun, 26 Nov 2023 22:57:26 +0000 Subject: [PATCH] fix overlay panel closes when subelements are clicked (#14177) --- src/app/components/overlaypanel/overlaypanel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); }); }