Skip to content

Commit

Permalink
Trying to correct an error in the focus implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea-Guevara authored and tdonohue committed Dec 19, 2024
1 parent 75260b0 commit a8ff6a4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
/**
* Implemented to manage focus on input
*/
@ViewChild('searchInput') searchInput: ElementRef;
@ViewChild('searchInput') searchInput!: ElementRef;

/**
* The {@link VocabularyOptions} object
Expand Down Expand Up @@ -299,7 +299,9 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
this.storedNodeMap = new Map<string, TreeviewFlatNode>();
this.vocabularyTreeviewService.restoreNodes();
}
this.searchInput.nativeElement.focus();
if (this.searchInput) {
this.searchInput.nativeElement.focus();
}
}

add() {
Expand Down

0 comments on commit a8ff6a4

Please sign in to comment.