Skip to content

Commit

Permalink
Fixed OverlayPanel containing component
Browse files Browse the repository at this point in the history
Fixes case when a component is present inside the OverlayPanel. After a low number of clicks inside the OverlayPanel it hid randomically.
  • Loading branch information
gamerish96 authored Oct 5, 2023
1 parent bf9d72a commit 5798e55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/components/overlaypanel/overlaypanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ 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.contains(event.target)) {
if (!this.container?.contains(event.target) && this.target !== event.target && !this.target.contains(event.target)) {
this.hide();
}

Expand Down

0 comments on commit 5798e55

Please sign in to comment.