Skip to content

Commit

Permalink
Fixed #15828 - Tree | Accessibility within Tree Component
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Jun 12, 2024
1 parent e5f593e commit 3e4b112
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 3e4b112

Please sign in to comment.