Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/primefaces/primeng
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Sep 27, 2023
2 parents 76d89b0 + ae07ab3 commit 9ed04d1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/app/components/confirmpopup/confirmpopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ export class ConfirmPopup implements AfterContentInit, OnDestroy {
ZIndexUtils.set('overlay', this.container, this.config.zIndex.overlay);
}

if (!this.confirmation) {
return;
}
DomHandler.absolutePosition(this.container, this.confirmation?.target);

const containerOffset = DomHandler.getOffset(this.container);
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/megamenu/megamenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
ViewChild,
ViewEncapsulation,
effect,
forwardRef,
signal
} from '@angular/core';
import { RouterModule } from '@angular/router';
Expand Down Expand Up @@ -226,7 +227,7 @@ export class MegaMenuSub {

@ViewChild('menubar', { static: true }) menubarViewChild: ElementRef;

constructor(public el: ElementRef, public megaMenu: MegaMenu) {}
constructor(public el: ElementRef, @Inject(forwardRef(() => MegaMenu)) public megaMenu: MegaMenu) {}

onItemClick(event: any, processedItem: any) {
this.getItemProp(processedItem, 'command', { originalEvent: event, item: processedItem.item });
Expand Down
14 changes: 10 additions & 4 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3338,7 +3338,7 @@ export class SortableColumn implements OnInit, OnDestroy {

@HostListener('click', ['$event'])
onClick(event: MouseEvent) {
if (this.isEnabled()) {
if (this.isEnabled() && !this.isFilterElement(<HTMLElement>event.target)) {
this.updateSortState();
this.dt.sort({
originalEvent: event,
Expand All @@ -3358,6 +3358,13 @@ export class SortableColumn implements OnInit, OnDestroy {
return this.pSortableColumnDisabled !== true;
}

isFilterElement(element: HTMLElement) {
return this.isFilterElementIconOrButton(element) || this.isFilterElementIconOrButton(element?.parentElement?.parentElement);
}
private isFilterElementIconOrButton(element: HTMLElement) {
return DomHandler.hasClass(element, 'pi-filter-icon') || DomHandler.hasClass(element, 'p-column-filter-menu-button');
}

ngOnDestroy() {
if (this.subscription) {
this.subscription.unsubscribe();
Expand Down Expand Up @@ -4777,7 +4784,7 @@ export class ReorderableRow implements AfterViewInit {
aria-haspopup="true"
[attr.aria-expanded]="overlayVisible"
[ngClass]="{ 'p-column-filter-menu-button-open': overlayVisible, 'p-column-filter-menu-button-active': hasFilter() }"
(click)="toggleMenu($event)"
(click)="toggleMenu()"
(keydown)="onToggleButtonKeyDown($event)"
>
<FilterIcon [styleClass]="'pi-filter-icon'" *ngIf="!filterIconTemplate" />
Expand Down Expand Up @@ -5108,9 +5115,8 @@ export class ColumnFilter implements AfterContentInit {
}
}

toggleMenu(event: any) {
toggleMenu() {
this.overlayVisible = !this.overlayVisible;
event.stopPropagation();
}

onToggleButtonKeyDown(event: KeyboardEvent) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ export class UITreeNode implements OnInit {
onKeyDown(event: KeyboardEvent) {
const nodeElement = (<HTMLDivElement>event.target).parentElement?.parentElement;

if (nodeElement?.nodeName !== 'P-TREENODE' || (this.tree.contextMenu && this.tree.contextMenu.containerViewChild.nativeElement.style.display === 'block')) {
if (nodeElement?.nodeName !== 'P-TREENODE' || (this.tree.contextMenu && this.tree.contextMenu.containerViewChild?.nativeElement.style.display === 'block')) {
return;
}

Expand Down

1 comment on commit 9ed04d1

@vercel
Copy link

@vercel vercel bot commented on 9ed04d1 Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.