Skip to content

Commit

Permalink
Fixed #10642 - Overlay panel hide when clicking on a label inside of it
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Sep 21, 2021
1 parent 403a531 commit 4417ded
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/components/overlaypanel/overlaypanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Subscription } from 'rxjs';
<div *ngIf="render" [ngClass]="'p-overlaypanel p-component'" [ngStyle]="style" [class]="styleClass" (click)="onOverlayClick($event)"
[@animation]="{value: (overlayVisible ? 'open': 'close'), params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}"
(@animation.start)="onAnimationStart($event)" (@animation.done)="onAnimationEnd($event)">
<div class="p-overlaypanel-content">
<div class="p-overlaypanel-content" (click)="onContentClick()" (mousedown)="onContentClick()">
<ng-content></ng-content>
<ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
</div>
Expand Down Expand Up @@ -180,6 +180,10 @@ export class OverlayPanel implements AfterContentInit, OnDestroy {
this.selfClick = true;
}

onContentClick() {
this.selfClick = true;
}

hasTargetChanged(event, target) {
return this.target != null && this.target !== (target||event.currentTarget||event.target);
}
Expand Down

0 comments on commit 4417ded

Please sign in to comment.