mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-1715] Search popup appears when navigating away from search results (#610)
This commit is contained in:
committed by
Denys Vuika
parent
c687c22cc3
commit
f03196d424
@@ -117,13 +117,14 @@ export class SearchInputControlComponent implements OnInit, OnDestroy {
|
||||
subscriptAnimationState: string;
|
||||
noSearchResultTemplate: TemplateRef <any> = null;
|
||||
skipToggle = false;
|
||||
toggleDebounceTime = 200;
|
||||
|
||||
private toggleSearch = new Subject<any>();
|
||||
private focusSubject = new Subject<FocusEvent>();
|
||||
|
||||
constructor(private thumbnailService: ThumbnailService) {
|
||||
|
||||
this.toggleSearch.asObservable().pipe(debounceTime(200)).subscribe(() => {
|
||||
this.toggleSearch.asObservable().pipe(debounceTime(this.toggleDebounceTime)).subscribe(() => {
|
||||
if (this.expandable && !this.skipToggle) {
|
||||
this.subscriptAnimationState = this.subscriptAnimationState === 'inactive' ? 'active' : 'inactive';
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
[highlight]="true"
|
||||
(optionClicked)="onItemClicked($event)"
|
||||
[expandable]="!onSearchResults"
|
||||
[liveSearchEnabled]="!onSearchResults"
|
||||
[liveSearchEnabled]="enableLiveSearch"
|
||||
(submit)="onSearchSubmit($event)"
|
||||
(searchChange)="onSearchChange($event)">
|
||||
</app-search-input-control>
|
||||
|
@@ -46,6 +46,7 @@ export class SearchInputComponent implements OnInit {
|
||||
hasOneChange = false;
|
||||
hasNewChange = false;
|
||||
navigationTimer: any;
|
||||
enableLiveSearch = true;
|
||||
|
||||
@ViewChild('searchInputControl')
|
||||
searchInputControl: SearchInputControlComponent;
|
||||
@@ -78,6 +79,7 @@ export class SearchInputComponent implements OnInit {
|
||||
}
|
||||
|
||||
if (this.searchInputControl) {
|
||||
this.enableLiveSearch = false;
|
||||
this.searchInputControl.searchTerm = searchedWord;
|
||||
this.searchInputControl.subscriptAnimationState = 'no-animation';
|
||||
}
|
||||
@@ -88,6 +90,12 @@ export class SearchInputComponent implements OnInit {
|
||||
this.searchInputControl.searchTerm = '';
|
||||
this.searchInputControl.toggleSearchBar();
|
||||
}
|
||||
|
||||
if (!this.enableLiveSearch) {
|
||||
setTimeout(() => {
|
||||
this.enableLiveSearch = true;
|
||||
}, this.searchInputControl.toggleDebounceTime + 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user