diff --git a/src/app/components/tree/tree.ts b/src/app/components/tree/tree.ts index d65a9fe7ccf..8d86a8ba8f4 100755 --- a/src/app/components/tree/tree.ts +++ b/src/app/components/tree/tree.ts @@ -1371,8 +1371,9 @@ export class Tree implements OnInit, AfterContentInit, OnChanges, OnDestroy, Blo onNodeRightClick(event: MouseEvent, node: TreeNode) { if (this.contextMenu) { let eventTarget = event.target; + let className = eventTarget.getAttribute('class'); - if (eventTarget.className && eventTarget.className.indexOf('p-tree-toggler') === 0) { + if (className && className.includes('p-tree-toggler')) { return; } else { let index = this.findIndexInSelection(node);