Skip to content

Commit

Permalink
Merge pull request #15829 from primefaces/issue-15828
Browse files Browse the repository at this point in the history
Fixed #15828 - Tree | Accessibility within Tree Component
  • Loading branch information
cetincakiroglu committed Jun 13, 2024
2 parents bbb9bb2 + 3e4b112 commit aab60c9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,9 @@ export class UITreeNode implements OnInit {
onEnter(event: KeyboardEvent) {
this.tree.onNodeClick(event, <TreeNode>this.node);
this.setTabIndexForSelectionMode(event, this.tree.nodeTouched);
event.preventDefault();
if (!(event.target instanceof HTMLElement && event.target.nodeName === 'A')) {
event.preventDefault();
}
}

setAllNodesTabIndexes() {
Expand Down Expand Up @@ -1155,12 +1157,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

0 comments on commit aab60c9

Please sign in to comment.