From b26450086a23751d8ea00b5b8ff7de80792b609d Mon Sep 17 00:00:00 2001 From: Matthew Sinex Date: Tue, 19 Mar 2024 16:22:44 -0400 Subject: [PATCH] Fixed #14987 - Table | Date filter closing when selecting any target within the p-datepicker dialog --- src/app/components/table/table.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index 3f8c1234b09..7ee8be94ae6 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -5617,7 +5617,10 @@ export class ColumnFilter implements AfterContentInit { const documentTarget: any = this.el ? this.el.nativeElement.ownerDocument : 'document'; this.documentClickListener = this.renderer.listen(documentTarget, 'mousedown', (event) => { - if (this.overlayVisible && this.isOutsideClicked(event)) { + const dialogElements = document.querySelectorAll('[role="dialog"]'); + const targetIsColumnFilterMenuButton = event.target.closest('.p-column-filter-menu-button'); + + if (this.overlayVisible && this.isOutsideClicked(event) && (targetIsColumnFilterMenuButton || dialogElements?.length <= 1)) { this.hide(); }