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 committed Sep 27, 2024
1 parent 3658ad1 commit 73d39ab
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();

Check warning on line 343 in src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts

View check run for this annotation

Codecov / codecov/patch

src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts#L343

Added line #L343 was not covered by tests
}
}

add() {
Expand Down

0 comments on commit 73d39ab

Please sign in to comment.