Skip to content

Commit

Permalink
Fixed #12382 - MultiSelect: onPanelHide triggers twice
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Jan 2, 2023
1 parent 7b11857 commit 95cd25d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/app/components/overlay/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,14 @@ export class Overlay implements AfterContentInit, OnDestroy {
}

hide(overlay?: HTMLElement, isFocus: boolean = false) {
this.onVisibleChange(false);
this.handleEvents('onHide', { overlay: overlay || this.overlayEl, target: this.targetEl, mode: this.overlayMode });

isFocus && DomHandler.focus(this.targetEl);
this.modal && DomHandler.removeClass(this.document?.body, 'p-overflow-hidden');
if (!this.visible) {
return;
} else {
this.onVisibleChange(false);
this.handleEvents('onHide', { overlay: overlay || this.overlayEl, target: this.targetEl, mode: this.overlayMode });
isFocus && DomHandler.focus(this.targetEl);
this.modal && DomHandler.removeClass(this.document?.body, 'p-overflow-hidden');
}
}

alignOverlay() {
Expand All @@ -360,7 +363,7 @@ export class Overlay implements AfterContentInit, OnDestroy {
this.visibleChange.emit(visible);
}

onOverlayClick() {
onOverlayClick(event) {
this.isOverlayClicked = true;
}

Expand Down

0 comments on commit 95cd25d

Please sign in to comment.