Skip to content

Commit

Permalink
Merge pull request #15300 from primefaces/issue-15233
Browse files Browse the repository at this point in the history
Fixed #15233 | Refactor condition for outsideClick
  • Loading branch information
cetincakiroglu authored Apr 18, 2024
2 parents c4f794c + e23fd69 commit 87b630b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5612,6 +5612,7 @@ export class ColumnFilter implements AfterContentInit {

isOutsideClicked(event: any): boolean {
return !(
DomHandler.hasClass(this.overlay?.nextElementSibling, 'p-overlay') ||
this.overlay?.isSameNode(event.target) ||
this.overlay?.contains(event.target) ||
this.icon?.nativeElement.isSameNode(event.target) ||
Expand All @@ -5630,7 +5631,6 @@ export class ColumnFilter implements AfterContentInit {
this.documentClickListener = this.renderer.listen(documentTarget, 'mousedown', (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();
}
Expand Down

0 comments on commit 87b630b

Please sign in to comment.