mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 18:44:14 +00:00
Adding focus to the input after the reset button is clicked
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<div class="treeview-header row mb-1">
|
<div class="treeview-header row mb-1">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" [(ngModel)]="searchText" (keyup.enter)="search()"
|
<input #searchInput type="text" class="form-control" [(ngModel)]="searchText" (keyup.enter)="search()"
|
||||||
[attr.aria-label]="'vocabulary-treeview.search.form.search-placeholder' | translate"
|
[attr.aria-label]="'vocabulary-treeview.search.form.search-placeholder' | translate"
|
||||||
[placeholder]="'vocabulary-treeview.search.form.search-placeholder' | translate">
|
[placeholder]="'vocabulary-treeview.search.form.search-placeholder' | translate">
|
||||||
<div class="input-group-append" id="button-addon4">
|
<div class="input-group-append" id="button-addon4">
|
||||||
|
@@ -8,6 +8,7 @@ import {
|
|||||||
} from '@angular/common';
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
|
ElementRef,
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
Input,
|
Input,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
@@ -15,6 +16,7 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
Output,
|
Output,
|
||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
|
ViewChild,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
@@ -70,6 +72,11 @@ export type VocabularyTreeItemType = FormFieldMetadataValueObject | VocabularyEn
|
|||||||
})
|
})
|
||||||
export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges {
|
export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implemented to manage focus on input
|
||||||
|
*/
|
||||||
|
@ViewChild('searchInput') searchInput: ElementRef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link VocabularyOptions} object
|
* The {@link VocabularyOptions} object
|
||||||
*/
|
*/
|
||||||
@@ -332,6 +339,7 @@ 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();
|
||||||
}
|
}
|
||||||
|
this.searchInput.nativeElement.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
add() {
|
add() {
|
||||||
|
Reference in New Issue
Block a user