diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html index a0d320a8544..ad894328a61 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html @@ -2,17 +2,20 @@
-
- - -
@@ -21,9 +24,11 @@
-

- {{'vocabulary-treeview.search.no-result' | translate}} -

+
+

+ {{'vocabulary-treeview.search.no-result' | translate}} +

+
@@ -88,13 +93,15 @@

- - diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts index b1edda461e5..56956440406 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts @@ -1,5 +1,5 @@ import { FlatTreeControl } from '@angular/cdk/tree'; -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, OnChanges, SimpleChanges } from '@angular/core'; +import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, OnChanges, SimpleChanges, ViewChild } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; import { Store } from '@ngrx/store'; @@ -29,6 +29,11 @@ import { AlertType } from '../../alert/alert-type'; }) export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges { + /** + * Implemented to manage focus on input + */ + @ViewChild('searchInput') searchInput!: ElementRef; + /** * The {@link VocabularyOptions} object */ @@ -294,6 +299,9 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges this.storedNodeMap = new Map(); this.vocabularyTreeviewService.restoreNodes(); } + if (this.searchInput) { + this.searchInput.nativeElement.focus(); + } } add() {