Trying to correct an error in the focus implementation

This commit is contained in:
andreaNeki
2024-09-27 16:18:56 -03:00
committed by Tim Donohue
parent 75260b00d9
commit a8ff6a41e0

View File

@@ -32,7 +32,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
/** /**
* Implemented to manage focus on input * Implemented to manage focus on input
*/ */
@ViewChild('searchInput') searchInput: ElementRef; @ViewChild('searchInput') searchInput!: ElementRef;
/** /**
* The {@link VocabularyOptions} object * The {@link VocabularyOptions} object
@@ -299,8 +299,10 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
this.storedNodeMap = new Map<string, TreeviewFlatNode>(); this.storedNodeMap = new Map<string, TreeviewFlatNode>();
this.vocabularyTreeviewService.restoreNodes(); this.vocabularyTreeviewService.restoreNodes();
} }
if (this.searchInput) {
this.searchInput.nativeElement.focus(); this.searchInput.nativeElement.focus();
} }
}
add() { add() {
const userVocabularyEntry = { const userVocabularyEntry = {