mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Blur live search input after emiting 'search' event
- Ensures that the drop-down disappears from screen Refs #228
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Control, Validators } from '@angular/common';
|
||||
import { Component, Input, Output, EventEmitter, AfterViewInit } from '@angular/core';
|
||||
import { Component, Input, Output, ElementRef, EventEmitter, AfterViewInit, ViewChild } from '@angular/core';
|
||||
import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { AlfrescoSearchAutocompleteComponent } from './alfresco-search-autocomplete.component';
|
||||
|
||||
@@ -58,6 +58,8 @@ export class AlfrescoSearchControlComponent implements AfterViewInit {
|
||||
|
||||
searchControl: Control;
|
||||
|
||||
@ViewChild('searchInput', {}) searchInput: ElementRef;
|
||||
|
||||
@Input()
|
||||
autocompleteSearchTerm = '';
|
||||
|
||||
@@ -114,7 +116,7 @@ export class AlfrescoSearchControlComponent implements AfterViewInit {
|
||||
this.searchChange.emit({
|
||||
value: this.searchTerm
|
||||
});
|
||||
// this.router.navigate(['Search', term]);
|
||||
this.searchInput.nativeElement.blur();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user