Skip to content

Commit

Permalink
Fixed #15233 - Dropdown | Dropdown in Table Filter Menu Fails to Appl…
Browse files Browse the repository at this point in the history
…y Filter When appendTo=body Is Used
  • Loading branch information
mehmetcetin01140 committed Apr 16, 2024
1 parent 4f88444 commit 80ad996
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 80ad996

Please sign in to comment.