Trying to correct an error in the focus implementation

(cherry picked from commit 73d39abfe5)
This commit is contained in:
andreaNeki
2024-09-27 16:18:56 -03:00
committed by github-actions[bot]
parent 8e25c178eb
commit 5d410b7c53

View File

@@ -75,7 +75,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
@@ -339,7 +339,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() {