Skip to content

Commit 8729ea5

Browse files
Merge pull request primefaces#12446 from primefaces/issue-12382
Fixed primefaces#12382 - MultiSelect: onPanelHide triggers twice
2 parents 7b11857 + 95cd25d commit 8729ea5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/app/components/overlay/overlay.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,14 @@ export class Overlay implements AfterContentInit, OnDestroy {
344344
}
345345

346346
hide(overlay?: HTMLElement, isFocus: boolean = false) {
347-
this.onVisibleChange(false);
348-
this.handleEvents('onHide', { overlay: overlay || this.overlayEl, target: this.targetEl, mode: this.overlayMode });
349-
350-
isFocus && DomHandler.focus(this.targetEl);
351-
this.modal && DomHandler.removeClass(this.document?.body, 'p-overflow-hidden');
347+
if (!this.visible) {
348+
return;
349+
} else {
350+
this.onVisibleChange(false);
351+
this.handleEvents('onHide', { overlay: overlay || this.overlayEl, target: this.targetEl, mode: this.overlayMode });
352+
isFocus && DomHandler.focus(this.targetEl);
353+
this.modal && DomHandler.removeClass(this.document?.body, 'p-overflow-hidden');
354+
}
352355
}
353356

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

363-
onOverlayClick() {
366+
onOverlayClick(event) {
364367
this.isOverlayClicked = true;
365368
}
366369

0 commit comments

Comments
 (0)