Skip to content

Commit

Permalink
Fixed #15714 - pTree: right click on treenode chevron down
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Jun 11, 2024
1 parent e5f593e commit ff394b2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1155,12 +1155,7 @@ export class Tree implements OnInit, AfterContentInit, OnChanges, OnDestroy, Blo

public dragStopSubscription: Subscription | undefined | null;

constructor(
public el: ElementRef,
@Optional() public dragDropService: TreeDragDropService,
public config: PrimeNGConfig,
private cd: ChangeDetectorRef
) {}
constructor(public el: ElementRef, @Optional() public dragDropService: TreeDragDropService, public config: PrimeNGConfig, private cd: ChangeDetectorRef) {}

ngOnInit() {
if (this.droppableNodes) {
Expand Down Expand Up @@ -1374,8 +1369,14 @@ export class Tree implements OnInit, AfterContentInit, OnChanges, OnDestroy, Blo
onNodeRightClick(event: MouseEvent, node: TreeNode<any>) {
if (this.contextMenu) {
let eventTarget = <Element>event.target;
let className;

if (eventTarget.className && eventTarget.className.indexOf('p-tree-toggler') === 0) {
if (eventTarget instanceof SVGElement) {
className = eventTarget.getAttribute('class');
} else {
className = eventTarget.className;
}
if (className && className.indexOf('p-tree-toggler') === 0) {
return;
} else {
let index = this.findIndexInSelection(node);
Expand Down

0 comments on commit ff394b2

Please sign in to comment.