Skip to content

Commit

Permalink
queried the date-picker class to fix the issue
Browse files Browse the repository at this point in the history
fixes primefaces#16020 without breaking the primefaces#14987
  • Loading branch information
codizen-dev committed Jul 21, 2024
1 parent 1df5b67 commit 33def4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5133,7 +5133,7 @@ export class ReorderableRow implements AfterViewInit {
[ngClass]="{ 'p-column-filter-overlay p-component p-fluid': true, 'p-column-filter-overlay-menu': display === 'menu' }"
[id]="overlayId"
[attr.aria-modal]="true"
role="filterDialog"
role="dialog"
(click)="onContentClick()"
[@overlayAnimation]="'visible'"
(@overlayAnimation.start)="onOverlayAnimationStart($event)"
Expand Down Expand Up @@ -5788,9 +5788,10 @@ export class ColumnFilter implements AfterContentInit {
const documentTarget: any = this.el ? this.el.nativeElement.ownerDocument : 'document';

this.documentClickListener = this.renderer.listen(documentTarget, 'mousedown', (event) => {
const dialogElements = document.querySelectorAll('[role="filterDialog"]');
let isDateDialog = false;
document.querySelectorAll('[role="dialog"]').forEach(d => { if(DomHandler.hasClass(d, 'p-datepicker')) isDateDialog = true; });
const targetIsColumnFilterMenuButton = event.target.closest('.p-column-filter-menu-button');
if (this.overlayVisible && this.isOutsideClicked(event) && (targetIsColumnFilterMenuButton || dialogElements?.length <= 1)) {
if (this.overlayVisible && this.isOutsideClicked(event) && (targetIsColumnFilterMenuButton || !isDateDialog)) {
this.hide();
}

Expand Down

0 comments on commit 33def4e

Please sign in to comment.