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 758d1426e06..f55f26aa685 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html @@ -2,20 +2,24 @@
-
- - - -
@@ -24,9 +28,11 @@
-

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

+
+

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

+
@@ -91,13 +97,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 cd836a4a473..89d908ec7f7 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts @@ -8,6 +8,7 @@ import { } from '@angular/common'; import { Component, + ElementRef, EventEmitter, Input, OnChanges, @@ -15,6 +16,7 @@ import { OnInit, Output, SimpleChanges, + ViewChild, } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; @@ -70,6 +72,11 @@ export type VocabularyTreeItemType = FormFieldMetadataValueObject | VocabularyEn }) export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges { + /** + * Implemented to manage focus on input + */ + @ViewChild('searchInput') searchInput!: ElementRef; + /** * The {@link VocabularyOptions} object */ @@ -332,6 +339,9 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges this.storedNodeMap = new Map(); this.vocabularyTreeviewService.restoreNodes(); } + if (this.searchInput) { + this.searchInput.nativeElement.focus(); + } } add() {