Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin-mladenov committed Sep 30, 2024
1 parent f0cc6d2 commit 2fc763d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions projects/angular/src/data/tree-view/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ export class ClrTree<T> implements AfterContentInit, OnDestroy {
ngZone: NgZone
) {
const subscription = ngZone.runOutsideAngular(() =>
fromEvent(this.el.nativeElement, 'focusin').subscribe((event: FocusEvent) => {
if (event.target === this.el.nativeElement) {
fromEvent(el.nativeElement, 'focusin').subscribe((event: FocusEvent) => {
if (event.target === el.nativeElement) {
// After discussing with the team, I've made it so that when the tree receives focus, the first visible node will be focused.
// This will prevent from the page scrolling abruptly to the first selected node if it exist in a deeply nested tree.
focusManagerService.focusFirstVisibleNode();
// when the first child gets focus,
// tree should no longer have tabindex of 0.
renderer.removeAttribute(this.el.nativeElement, 'tabindex');
renderer.removeAttribute(el.nativeElement, 'tabindex');
}
})
);
Expand Down

0 comments on commit 2fc763d

Please sign in to comment.