From 80ad9962b963250aa9d00c25f4583f40e4ffca3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:52:16 +0300 Subject: [PATCH] Fixed #15233 - Dropdown | Dropdown in Table Filter Menu Fails to Apply Filter When appendTo=body Is Used --- src/app/components/table/table.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index 1e426e5fb25..f9e4f51e56c 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -5631,9 +5631,13 @@ export class ColumnFilter implements AfterContentInit { 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(); - } + dialogElements.forEach((dialogElement) => { + const appendToBodyExists = dialogElement.querySelector('p-dropdown[appendto="body"]') !== null; + + if (this.overlayVisible && this.isOutsideClicked(event) && !appendToBodyExists && (targetIsColumnFilterMenuButton || dialogElements?.length <= 1)) { + this.hide(); + } + }); this.selfClick = false; });